Create a LayoutToggle story

This commit is contained in:
Robin
2026-03-30 17:59:47 +02:00
parent 2de151d94d
commit 4cf75c8eeb
2 changed files with 27 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
/*
Copyright 2026 Element Creations Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE in the repository root for full details.
*/
import { fn } from "storybook/test";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { LayoutToggle } from "./LayoutToggle";
const meta = {
component: LayoutToggle,
} satisfies Meta<typeof LayoutToggle>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
layout: "grid",
setLayout: fn(),
},
};

View File

@@ -18,11 +18,11 @@ import styles from "./LayoutToggle.module.css";
export type Layout = "spotlight" | "grid";
interface Props {
type Props = {
layout: Layout;
setLayout: (layout: Layout) => void;
className?: string;
}
};
export const LayoutToggle: FC<Props> = ({ layout, setLayout, className }) => {
const { t } = useTranslation();