ol-table.tsx 981 B

1234567891011121314151617181920212223242526272829303132
  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. import { getAriaAndDataProps } from '@/features/utils/bootstrap-5'
  5. type OLFormProps = React.ComponentProps<typeof Table> & {
  6. bs3Props?: React.ComponentProps<typeof BS3Table>
  7. }
  8. function OLTable(props: OLFormProps) {
  9. const { bs3Props, container, ...rest } = props
  10. const bs3FormProps: React.ComponentProps<typeof BS3Table> = {
  11. bsClass: rest.className,
  12. id: rest.id,
  13. condensed: rest.size === 'sm',
  14. children: rest.children,
  15. responsive:
  16. typeof rest.responsive !== 'string' ? rest.responsive : undefined,
  17. ...getAriaAndDataProps(rest),
  18. ...bs3Props,
  19. }
  20. return (
  21. <BootstrapVersionSwitcher
  22. bs3={<BS3Table {...bs3FormProps} />}
  23. bs5={<Table container={container} {...rest} />}
  24. />
  25. )
  26. }
  27. export default OLTable