import { ReactNode } from "react";
import { Action, KBarAnimator, KBarPortal, KBarPositioner, KBarProvider, KBarResults, KBarSearch, useMatches } from "kbar";
import clsx from "clsx";
import UserGroupIconFilled from "../icons/UserGroupIconFilled";
/* import AdminCommandHelper from "~/utils/helpers/commands/AdminCommandHelper";
import AppCommandHelper from "~/utils/helpers/commands/AppCommandHelper";
import DocsCommandHelper from "~/utils/helpers/commands/DocsCommandHelper"; */
import { useApp } from "../../../hooks";
import { useRouter } from "next/navigation";
interface Props {
layout: "app" | "admin" | "docs";
children: ReactNode;
}
export default function CommandPalette({ layout, children }: Props) {
const { t } = useApp();
const navigate = useRouter();
const appData: any = {}//useAppData();
let actions: Action[] = [];
/* if (layout === "app") {
actions = AppCommandHelper.getCommands({ t, navigate, appData });
} else if (layout === "admin") {
actions = AdminCommandHelper.getCommands({ t, navigate });
} else if (layout === "docs") {
actions = DocsCommandHelper.getCommands({ t, navigate });
} */
return (
{
return {
...i,
icon: ,
};
})}
>
{children}
);
}
function CommandBar() {
return (
);
}
function RenderResults() {
const { results } = useMatches();
return (
(
<>
{typeof item === "string" ? (
) : (
{/* {item.icon &&
{item.icon}
} */}
{item.name}
{item.subtitle}
)}
>
)}
/>
);
}