MCPcopy Index your code
hub / github.com/OpenCut-app/OpenCut / SectionContent

Function SectionContent

apps/web/src/components/section.tsx:230–257  ·  view source on GitHub ↗
({
	children,
	className,
}: {
	children: React.ReactNode;
	className?: string;
})

Source from the content-addressed store, hash-verified

228}
229
230export function SectionContent({
231 children,
232 className,
233}: {
234 children: React.ReactNode;
235 className?: string;
236}) {
237 const ctx = useSectionContext();
238 const isCollapsible = ctx?.collapsible ?? false;
239 const isOpen = ctx?.isOpen ?? true;
240
241 const content = <div className={cn("p-4 pt-0", className)}>{children}</div>;
242
243 if (isCollapsible) {
244 return (
245 <div
246 className={cn(
247 "grid transition-[grid-template-rows] duration-100 ease-out",
248 isOpen ? "grid-rows-[1fr]" : "grid-rows-[0fr]",
249 )}
250 >
251 <div className="overflow-hidden">{content}</div>
252 </div>
253 );
254 }
255
256 return content;
257}

Callers

nothing calls this directly

Calls 2

cnFunction · 0.90
useSectionContextFunction · 0.70

Tested by

no test coverage detected