overleaf/services/web/frontend/js/features/ui/components/ol/ol-table.tsx
ilkin-overleaf c3ed95bc48 Merge pull request #19027 from overleaf/ii-bs5-projects-list-table
[web] BS5 projects table migration

GitOrigin-RevId: 237bd8113c68d7fd1b66712f7361eb956b1e10e7
2024-07-15 09:03:45 +00:00

29 lines
863 B
TypeScript

import Table from '@/features/ui/components/bootstrap-5/table'
import { Table as BS3Table } from 'react-bootstrap'
import BootstrapVersionSwitcher from '@/features/ui/components/bootstrap-5/bootstrap-version-switcher'
type OLFormProps = React.ComponentProps<typeof Table> & {
bs3Props?: React.ComponentProps<typeof BS3Table>
}
function OLTable(props: OLFormProps) {
const { bs3Props, container, ...rest } = props
const bs3FormProps: React.ComponentProps<typeof BS3Table> = {
bsClass: rest.className,
condensed: rest.size === 'sm',
children: rest.children,
responsive:
typeof rest.responsive !== 'string' ? rest.responsive : undefined,
...bs3Props,
}
return (
<BootstrapVersionSwitcher
bs3={<BS3Table {...bs3FormProps} />}
bs5={<Table container={container} {...rest} />}
/>
)
}
export default OLTable