'use client'; import { useEffect, useState } from 'react'; import { cn } from '@/lib/utils'; import { useBrickStore } from '@/components/bricks/state/brick-state'; import { BrickCopyCode } from '@/components/bricks/brick-copy-code'; export const Brick = ({ className, children, demo, brick, }: { className?: string; children: React.ReactNode; demo: string; brick: string; }) => { const [isClient, setIsClient] = useState(false); const copyMode = useBrickStore((state) => state.copyModeEnabled); const copyModeOnClient = isClient && copyMode; useEffect(() => { setIsClient(true); }, []); return (
{copyModeOnClient ? : null} {children}
); };