import { type ReactNode } from 'react' import { useTranslation } from 'react-i18next' import { Skeleton } from '@/components/ui/skeleton' interface PanelWrapperProps { title: ReactNode loading?: boolean empty?: boolean emptyMessage?: string height?: string headerActions?: ReactNode children?: ReactNode } export function PanelWrapper(props: PanelWrapperProps) { const { t } = useTranslation() const resolvedEmptyMessage = props.emptyMessage ?? t('No data available') const height = props.height ?? 'h-64' if (props.loading) { return (
{props.title}
) } if (props.empty) { return (
{props.title}
{resolvedEmptyMessage}
) } return (
{props.headerActions ? (
{props.title}
{props.headerActions}
) : (
{props.title}
)}
{props.children}
) }