2022-09-02 15:30:34 +00:00
|
|
|
import { PropsWithChildren } from 'react';
|
2022-01-04 12:16:09 +00:00
|
|
|
|
2022-06-17 16:18:42 +00:00
|
|
|
import { Widget, WidgetBody } from '@@/Widget';
|
2022-01-04 12:16:09 +00:00
|
|
|
|
2022-11-22 12:16:34 +00:00
|
|
|
interface Props {
|
|
|
|
// workaround to remove the widget, ideally we should have a different component to wrap the table with a widget
|
|
|
|
noWidget?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function TableContainer({
|
|
|
|
children,
|
|
|
|
noWidget = false,
|
|
|
|
}: PropsWithChildren<Props>) {
|
|
|
|
if (noWidget) {
|
|
|
|
return <div className="datatable">{children}</div>;
|
|
|
|
}
|
|
|
|
|
2022-01-04 12:16:09 +00:00
|
|
|
return (
|
2022-11-22 12:16:34 +00:00
|
|
|
<div className="row">
|
|
|
|
<div className="col-sm-12">
|
|
|
|
<div className="datatable">
|
|
|
|
<Widget>
|
|
|
|
<WidgetBody className="no-padding">{children}</WidgetBody>
|
|
|
|
</Widget>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-09-02 15:30:34 +00:00
|
|
|
</div>
|
2022-01-04 12:16:09 +00:00
|
|
|
);
|
|
|
|
}
|