summaryrefslogtreecommitdiff
path: root/components/shell.tsx
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-03-25 15:55:45 +0900
committerjoonhoekim <26rote@gmail.com>2025-03-25 15:55:45 +0900
commit1a2241c40e10193c5ff7008a7b7b36cc1d855d96 (patch)
tree8a5587f10ca55b162d7e3254cb088b323a34c41b /components/shell.tsx
initial commit
Diffstat (limited to 'components/shell.tsx')
-rw-r--r--components/shell.tsx37
1 files changed, 37 insertions, 0 deletions
diff --git a/components/shell.tsx b/components/shell.tsx
new file mode 100644
index 00000000..8082109b
--- /dev/null
+++ b/components/shell.tsx
@@ -0,0 +1,37 @@
+import * as React from "react"
+import { cva, type VariantProps } from "class-variance-authority"
+
+import { cn } from "@/lib/utils"
+
+const shellVariants = cva("grid items-center gap-8 pb-8 pt-6 md:py-8", {
+ variants: {
+ variant: {
+ default: "container",
+ sidebar: "",
+ centered: "container flex h-dvh max-w-2xl flex-col justify-center py-16",
+ markdown: "container max-w-3xl py-8 md:py-10 lg:py-10",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+})
+
+interface ShellProps
+ extends React.HTMLAttributes<HTMLDivElement>,
+ VariantProps<typeof shellVariants> {
+ as?: React.ElementType
+}
+
+function Shell({
+ className,
+ as: Comp = "section",
+ variant,
+ ...props
+}: ShellProps) {
+ return (
+ <Comp className={cn(shellVariants({ variant }), className)} {...props} />
+ )
+}
+
+export { Shell, shellVariants }