Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/components/layout/Layout/Layout.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import type { Meta, StoryObj } from '@storybook/react-vite';

import { Layout } from './Layout';

const meta = {
component: Layout,
} satisfies Meta<typeof Layout>;

export default meta;

type Story = StoryObj<typeof meta>;

export const Default: Story = {
args: {
children: (
<div className="bg-base-100 p-4 rounded shadow">
<h2 className="text-lg font-semibold">Dashboard Content</h2>
<p>This content is rendered inside the Layout component.</p>
</div>
),
}
};
26 changes: 26 additions & 0 deletions src/components/layout/Layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import Header from "../Header/Header.tsx";
import type {LayoutProps} from "./LayoutProps.ts";

/**
* The main layout component for the application.
*
* This component wraps the application content with a consistent structure,
* including a header and a main content area.
*
* @param props - The component props.
* @param props.children - The child components to render within the main content area.
* @returns The rendered layout structure.
*/
export function Layout({children}: Readonly<LayoutProps>) {
return (<div className="min-h-screen bg-base-200">
<Header
user={null}
onLogout={() => {

}}
/>
<main className="container mx-auto p-4">
{children}
</main>
</div>);
}
11 changes: 11 additions & 0 deletions src/components/layout/Layout/LayoutProps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type {ReactNode} from "react";

/**
* Props for the {@link Layout} component.
*/
export interface LayoutProps {
/**
* The content to be rendered inside the main layout area.
*/
children?: ReactNode;
}