"use client"; import { ChevronDownIcon, WrenchIcon } from "lucide-react"; import { useTranslations } from "next-intl"; import { PropsWithChildren } from "react"; import { Button } from "ui/button"; import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from "ui/dropdown-menu"; export type EnabledTools = { groupName: string; tools: { name: string; description?: string; }[]; }; export function EnabledToolsDropdown({ children, align, side, tools = [], }: PropsWithChildren<{ align?: "start" | "end"; tools?: EnabledTools[]; side?: "left" | "right" | "top" | "bottom"; }>) { const t = useTranslations(); return ( {children || ( )} {tools.length ? ( tools.map((toolGroup, index) => { return (

{toolGroup.groupName}

{toolGroup.tools.map((tool) => { return (

{tool.name}

{tool.description}

); })}
); }) ) : (

{t("Chat.Tool.noToolsAvailable")}

)}
); }