import { Command } from "cmdk";
import { ContrastIcon, FileText } from "lucide-react";
// hooks
import { useApplication } from "hooks/store";
// ui
import { DiceIcon, PhotoFilterIcon } from "@plane/ui";
type Props = {
closePalette: () => void;
};
export const CommandPaletteProjectActions: React.FC<Props> = (props) => {
const { closePalette } = props;
const {
commandPalette: { toggleCreateCycleModal, toggleCreateModuleModal, toggleCreatePageModal, toggleCreateViewModal },
eventTracker: { setTrackElement },
} = useApplication();
return (
<>
<Command.Group heading="Cycle">
<Command.Item
onSelect={() => {
closePalette();
setTrackElement("COMMAND_PALETTE");
toggleCreateCycleModal(true);
}}
className="focus:outline-none"
>
<div className="flex items-center gap-2 text-custom-text-200">
<ContrastIcon className="h-3.5 w-3.5" />
Create new cycle
</div>
<kbd>Q</kbd>
</Command.Item>
</Command.Group>
<Command.Group heading="Module">
toggleCreateModuleModal(true);
<DiceIcon className="h-3.5 w-3.5" />
Create new module
<kbd>M</kbd>
<Command.Group heading="View">
toggleCreateViewModal(true);
<PhotoFilterIcon className="h-3.5 w-3.5" />
Create new view
<kbd>V</kbd>
<Command.Group heading="Page">
toggleCreatePageModal(true);
<FileText className="h-3.5 w-3.5" />
Create new page
<kbd>D</kbd>
</>
);