mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
c3ed95bc48
[web] BS5 projects table migration GitOrigin-RevId: 237bd8113c68d7fd1b66712f7361eb956b1e10e7
40 lines
789 B
TypeScript
40 lines
789 B
TypeScript
import { Table as BS5Table } from 'react-bootstrap-5'
|
|
import classnames from 'classnames'
|
|
|
|
export function TableContainer({
|
|
responsive,
|
|
bordered,
|
|
children,
|
|
}: React.ComponentProps<typeof BS5Table>) {
|
|
return (
|
|
<div
|
|
className={classnames('table-container', {
|
|
'table-container-bordered': bordered,
|
|
'table-responsive': responsive,
|
|
})}
|
|
>
|
|
{children}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
type TableProps = React.ComponentProps<typeof BS5Table> & {
|
|
container?: boolean
|
|
}
|
|
|
|
function Table({
|
|
container = true,
|
|
responsive,
|
|
bordered,
|
|
...rest
|
|
}: TableProps) {
|
|
return container ? (
|
|
<TableContainer responsive={responsive} bordered={bordered}>
|
|
<BS5Table {...rest} />
|
|
</TableContainer>
|
|
) : (
|
|
<BS5Table {...rest} />
|
|
)
|
|
}
|
|
|
|
export default Table
|