mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-29 23:00:08 +02:00

Apply minor upgrades to Bootstrap 5 and react-bootstrap GitOrigin-RevId: eb013f38515ebd4b9572d139f00841aca344e3c6
43 lines
861 B
TypeScript
43 lines
861 B
TypeScript
import { Table as BS5Table } from 'react-bootstrap'
|
|
import classnames from 'classnames'
|
|
|
|
export function TableContainer({
|
|
responsive,
|
|
bordered,
|
|
striped,
|
|
children,
|
|
}: React.ComponentProps<typeof BS5Table>) {
|
|
return (
|
|
<div
|
|
className={classnames('table-container', {
|
|
'table-container-bordered': bordered,
|
|
'table-responsive': responsive,
|
|
'table-striped': striped,
|
|
})}
|
|
>
|
|
{children}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
type TableProps = React.ComponentProps<typeof BS5Table> & {
|
|
container?: boolean
|
|
}
|
|
|
|
function Table({
|
|
container = true,
|
|
responsive,
|
|
bordered,
|
|
striped,
|
|
...rest
|
|
}: TableProps) {
|
|
return container ? (
|
|
<TableContainer responsive={responsive} bordered={bordered}>
|
|
<BS5Table striped={striped} {...rest} />
|
|
</TableContainer>
|
|
) : (
|
|
<BS5Table {...rest} />
|
|
)
|
|
}
|
|
|
|
export default Table
|