import type { Table } from '@tanstack/react-table' import { ActionIcon, Group } from '@mantine/core' import { IconDownload } from '@tabler/icons-react' import { ColumnVisibilityMenu } from '../columnVisibility' import { exportToCsv } from '../export' interface GridToolbarProps { exportFilename?: string showColumnToggle?: boolean showExport?: boolean table: Table } export function GridToolbar({ exportFilename = 'export.csv', showColumnToggle = true, showExport = true, table, }: GridToolbarProps) { const handleExport = () => { exportToCsv(table, exportFilename) } if (!showExport && !showColumnToggle) { return null } return ( {showExport && ( )} {showColumnToggle && } ) }