diff --git a/src/components/Page/Page.tsx b/src/components/Page/Page.tsx index 0284560..f6fddce 100644 --- a/src/components/Page/Page.tsx +++ b/src/components/Page/Page.tsx @@ -1,22 +1,17 @@ import { ReactNode, useState } from "react"; -import { Menu, MenuItem, MenuItemComponentProps } from "../Menu/Menu"; +import { Menu, MenuItem } from "../Menu/Menu"; import { AppBar } from "../AppBar/AppBar"; -import { NetworkIndicator } from "../NetworkIndicator/NetworkIndicator"; import "./page.css"; -import { - Home, - Star, - ShoppingBag, - Server, - Settings, - HelpCircle, -} from "lucide-react"; type Props = { children: ReactNode; + + Right: ReactNode; + + items: MenuItem[]; }; -export function Page({ children }: Props) { +export function Page({ children, Right, items }: Props) { const [open, setOpen] = useState(false); const onClose = () => { @@ -27,76 +22,6 @@ export function Page({ children }: Props) { setOpen(true); }; - const Right = ; - - 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 (
diff --git a/src/index.ts b/src/index.ts index 8d7d6a5..627d4c1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -22,3 +22,10 @@ export { DefaultCellRender } from "./components/Table/CellRender"; export { DurationCellRender } from "./components/Table/DurationCellRender"; export { StateCellRender } from "./components/Table/StateCellRender"; export { Table } from "./components/Table/Table"; +export { + Menu, + type MenuItem, + type MenuItemComponentProps, +} from "./components/Menu/Menu"; +export { AppBar } from "./components/AppBar/AppBar"; +export { Page } from "./components/Page/Page"; diff --git a/stories/Page.stories.tsx b/stories/Page.stories.tsx index c3fc5df..1c908ae 100644 --- a/stories/Page.stories.tsx +++ b/stories/Page.stories.tsx @@ -1,6 +1,16 @@ import type { Meta, StoryObj } from "@storybook/react"; import { Page } from "../src/components/Page/Page"; import "./Page.stories.css"; +import { + Home, + Star, + ShoppingBag, + Server, + Settings, + HelpCircle, +} from "lucide-react"; +import { MenuItem, MenuItemComponentProps } from "../src/components/Menu/Menu"; +import { NetworkIndicator } from "../src/components/NetworkIndicator/NetworkIndicator"; const meta = { title: "Layouts/Page", @@ -20,5 +30,73 @@ export const Default: Story = { children: ( Hello World ), + 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[], + Right: , }, };