import { useEffect, FC } from 'react'; import { provide, useDependencies } from '@servicetitan/react-ioc'; import { Button } from '@servicetitan/design-system'; import { Table, TableColumn, TableCellProps, TableExpandChangeEvent } from '../..'; import { MasterTableStore } from './master-table.store'; import { DetailTable } from './detail-table'; const ExpandCell: FC = ({ tableState, dataItem, tdProps }) => { const handleExpandChange = () => { tableState!.handleExpandChange({ dataItem, value: !dataItem.expanded, } as TableExpandChangeEvent); }; return ( ); }; export const TableMasterDetailExample: FC = provide({ singletons: [MasterTableStore], })(() => { const [store] = useDependencies(MasterTableStore); useEffect(() => () => store.dispose()); return (
); });