ol-table.tsx 863 B

1234567891011121314151617181920212223242526272829
  1. import Table from '@/features/ui/components/bootstrap-5/table'
  2. import { Table as BS3Table } from 'react-bootstrap'
  3. import BootstrapVersionSwitcher from '@/features/ui/components/bootstrap-5/bootstrap-version-switcher'
  4. type OLFormProps = React.ComponentProps<typeof Table> & {
  5. bs3Props?: React.ComponentProps<typeof BS3Table>
  6. }
  7. function OLTable(props: OLFormProps) {
  8. const { bs3Props, container, ...rest } = props
  9. const bs3FormProps: React.ComponentProps<typeof BS3Table> = {
  10. bsClass: rest.className,
  11. condensed: rest.size === 'sm',
  12. children: rest.children,
  13. responsive:
  14. typeof rest.responsive !== 'string' ? rest.responsive : undefined,
  15. ...bs3Props,
  16. }
  17. return (
  18. <BootstrapVersionSwitcher
  19. bs3={<BS3Table {...bs3FormProps} />}
  20. bs5={<Table container={container} {...rest} />}
  21. />
  22. )
  23. }
  24. export default OLTable