web/components/Layout.tsx

32 lines
578 B
TypeScript

/**
* Copyright (c) 2025 misties
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { ComponentChildren } from "preact";
interface LayoutProps {
children: ComponentChildren;
[key: string]: any;
}
export function Section({ children, class: className, ...props }: LayoutProps) {
return (
<div
{...props}
class={`section ${className || ""}`}
>
{children}
</div>
);
}
export function Centered(
{ children, class: className, ...props }: LayoutProps,
) {
return (
<main class={`centered ${className || ""}`} {...props}>
{children}
</main>
);
}