import type { ReactNode } from 'react' import type { Table } from '@tanstack/react-table' import { cn } from '@evobgp/ui/lib/utils' import { DataGridToolbar } from '@/components/data-grid-toolbar' import { PanelCard, panelCardContentFlushClassName, panelCardFooterClassName, } from '@/components/panel-card' import { DataGridPagination } from '@/components/reui/data-grid/data-grid-pagination' import { DataGrid, DataGridContainer } from '@/components/reui/data-grid/data-grid' import { DataGridTable } from '@/components/reui/data-grid/data-grid-table' import { FrameFooter } from '@/components/reui/frame' import { DATA_GRID_MESSAGES_RU, DATA_GRID_PAGINATION_RU, DATA_GRID_TABLE_CLASS_NAMES, DATA_GRID_TABLE_LAYOUT, } from '@/lib/data-grid-defaults' interface DataGridShellProps { table: Table recordCount: number isLoading?: boolean emptyMessage?: ReactNode showPagination?: boolean tableLayout?: typeof DATA_GRID_TABLE_LAYOUT className?: string onRowClick?: (row: TData) => void } export function DataGridShell({ table, recordCount, isLoading = false, emptyMessage, showPagination = true, tableLayout = DATA_GRID_TABLE_LAYOUT, className, onRowClick, }: DataGridShellProps) { return ( {showPagination ? ( ) : null} ) } interface DataGridCardProps { title?: string description?: string actions?: ReactNode children: ReactNode className?: string } export function DataGridCard({ title, description, actions, children, className }: DataGridCardProps) { return ( {children} ) } interface DataGridSectionProps extends DataGridShellProps { searchValue: string onSearchChange: (value: string) => void searchPlaceholder?: string toolbarFilters?: ReactNode toolbarActions?: ReactNode beforeGrid?: ReactNode } export function DataGridSection({ searchValue, onSearchChange, searchPlaceholder, toolbarFilters, toolbarActions, beforeGrid, ...shellProps }: DataGridSectionProps) { return ( <> {beforeGrid} ) }