[as] rename: SectionCollapsible 컴포넌트 shared 레이어로 이동

This commit is contained in:
2026-08-07 15:34:26 +09:00
parent 12a0a37d24
commit 07a625e03b
57 changed files with 133 additions and 129 deletions
+1
View File
@@ -1,4 +1,5 @@
export { NoData } from "./no-data";
export { PageLayout } from "./page-layout";
export { SectionCollapsible } from "./section-collapsible";
export type { TextShimmerProps } from "./text-shimmer";
export { TEXT_SHIMMER_CLASS, TextShimmer } from "./text-shimmer";
@@ -0,0 +1,37 @@
"use client";
import type { ReactNode } from "react";
import { ChevronDown } from "lucide-react";
import { cn, Collapsible, CollapsibleContent, CollapsibleTrigger } from "@common/components";
interface SectionCollapsibleProps {
title: ReactNode;
defaultOpen?: boolean;
children: ReactNode;
}
function SectionCollapsible({ title, defaultOpen = true, children }: SectionCollapsibleProps) {
return (
<Collapsible defaultOpen={defaultOpen} className="mx-4 rounded-sm border bg-background">
<CollapsibleTrigger asChild>
<button
type="button"
className="group flex w-full cursor-pointer items-center justify-between border-b p-4 text-left data-[state=closed]:border-b-0"
>
<h2 className="text-2xl font-bold">{title}</h2>
<ChevronDown
className={cn(
"size-6 shrink-0 text-muted-foreground transition-transform",
"group-data-[state=open]:rotate-180",
)}
/>
</button>
</CollapsibleTrigger>
<CollapsibleContent className="p-2">{children}</CollapsibleContent>
</Collapsible>
);
}
export { SectionCollapsible };