Files
portainer/app/react/components/datatables/TableContainer.tsx
T
Josiah Clumont 484af3c2c8 feat(environment group) detail view update v1 [c9s-206] (#2722)
Last system-test failure is also on dev
2026-06-02 16:59:18 +12:00

34 lines
750 B
TypeScript

import { PropsWithChildren } from 'react';
import { Widget, WidgetBody } from '@@/Widget';
interface Props {
// workaround to remove the widget, ideally we should have a different component to wrap the table with a widget
noWidget?: boolean;
'aria-label'?: string;
id?: string;
}
export function TableContainer({
children,
noWidget = false,
'aria-label': ariaLabel,
id,
}: PropsWithChildren<Props>) {
if (noWidget) {
return (
<section className="datatable" aria-label={ariaLabel}>
{children}
</section>
);
}
return (
<div className="datatable">
<Widget aria-label={ariaLabel} id={id}>
<WidgetBody className="no-padding">{children}</WidgetBody>
</Widget>
</div>
);
}