import type React from "react";
import type { Group } from "@components/CommandPalette/Index.js";
import { Combobox } from "@headlessui/react";
import { ChevronRightIcon } from "@heroicons/react/24/outline";
export interface SearchResultProps {
group: Group;
}
export const SearchResult = ({ group }: SearchResultProps): JSX.Element => {
return (
{group.name}
{group.commands.map((command, index) => (
`mr-2 ml-4 flex cursor-pointer select-none items-center rounded-md px-3 py-1 ${
active ? "bg-gray-900 bg-opacity-5 text-gray-900" : ""
}`
}
>
{({ active }) => (
<>
{command.name}
{active && (
)}
>
)}
{command.subItems && (
{command.subItems?.map((item) => (
`mx-2 flex cursor-pointer select-none items-center rounded-md px-3 py-1 ${
active ? "bg-gray-900 bg-opacity-5 text-gray-900" : ""
}`
}
>
{({ active }) => (
<>
{item.name}
{active && (
)}
>
)}
))}
)}
))}
);
};