import { Children } from 'react' import { cn } from 'ui' export const FormSection = ({ children, id, header, disabled, className, }: { children: React.ReactNode id?: string header?: React.ReactNode disabled?: boolean visible?: boolean className?: string }) => { const classes = [ 'grid grid-cols-12 gap-6 px-card py-4 md:py-8', `${disabled ? ' opacity-30' : ' opacity-100'}`, `${className}`, ] return (
{header} {children}
) } export const FormSectionLabel = ({ children, className = '', description, }: { children: React.ReactNode | string className?: string description?: React.ReactNode }) => { if (description !== undefined) { return (
{description}
) } else { return ( ) } } const Shimmer = () => (
) export const FormSectionContent = ({ children, loading = true, loaders, fullWidth, className, }: { children: React.ReactNode | string loading?: boolean loaders?: number fullWidth?: boolean className?: string }) => { return (
{loading ? !!loaders ? new Array(loaders).fill(0).map((_, idx) => ) : Children.map(children, (_, idx) => ) : children}
) }