Skip to content
Source
Sign inSign up

WorkspacePageContainer.tsx

28 lines658 Bytes

1import type { ComponentPropsWithoutRef } from "react";
2​
3import { cn } from "../lib/utils";
4​
5export type WorkspacePageWidth = "readable" | "wide" | "expanded";
6​
7const WIDTH_CLASS: Record<WorkspacePageWidth, string> = {
8 readable: "max-w-4xl",
9 wide: "max-w-5xl",
10 expanded: "max-w-6xl",
11};
12​
13export function WorkspacePageContainer({
14 width = "readable",
15 className,
16 ...props
17}: ComponentPropsWithoutRef<"div"> & { readonly width?: WorkspacePageWidth }) {
18 return (
19 <div
20 className={cn(
21 "mx-auto flex w-full flex-col gap-6 px-5 pt-6 pb-12 sm:px-6",
22 WIDTH_CLASS[width],
23 className,
24 )}
25 {...props}
26 />
27 );