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>
    </>
  );
};
