dasig-solid/frontend/@dasig/components/Page.tsx
2025-11-26 10:56:07 +08:00

28 lines
616 B
TypeScript

import { Title } from "@solidjs/meta";
import { type JSXElement, Show } from "solid-js";
import "../styles/Page.sass";
interface Props {
children?: JSXElement;
alignment?: "row" | "column";
title: string;
}
export default (props: Props) => {
return (
<>
<Show when={props.alignment}>
<main class={props.alignment}>
<Title>{props.title}</Title>
{props.children}
</main>
</Show>
<Show when={!props.alignment}>
<main class="page">
<Title>{props.title}</Title>
{props.children}
</main>
</Show>
</>
);
};