import type { Meta } from "@storybook/react"; import { Menu, MenuItem, MenuItemComponentProps, } from "../src/components/Menu/Menu"; import { useState } from "react"; import { fn } from "@storybook/test"; import { HelpCircle, Home, Server, Settings, ShoppingBag, Star, } from "lucide-react"; import "./Menu.stories.css"; const meta = { title: "Overlays/Menu", component: Menu, parameters: { layout: "fullscreen", }, tags: ["autodocs"], argTypes: {}, args: { onClose: fn(), onOpen: fn(), }, } satisfies Meta; export default meta; type Props = { onClose: () => void; onOpen: () => void; }; const Template = (p: Props) => { const [open, setOpen] = useState(false); const onClose = () => { p.onClose(); setOpen(false); }; const onOpen = () => { setOpen(true); }; const items = [ { type: "menu-item", Component: (p: MenuItemComponentProps) => ( Dashboard ), }, { type: "menu-item", Component: (p: MenuItemComponentProps) => ( Favorties ), }, { type: "separator", }, { type: "menu-title", title: "rent", }, { type: "menu-item", Component: (p: MenuItemComponentProps) => ( Purchases ), }, { type: "separator", }, { type: "menu-title", title: "host", }, { type: "menu-item", Component: (p: MenuItemComponentProps) => ( Availabilities ), }, { type: "menu-item", Component: (p: MenuItemComponentProps) => ( Settings ), }, { type: "separator", }, { type: "menu-item", Component: (p: MenuItemComponentProps) => ( Help ), }, ] satisfies MenuItem[]; return (
); }; export const Default = Template;