You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/react/components/datatables/TableContainer.tsx

26 lines
654 B

import { createContext, PropsWithChildren, useContext } from 'react';
import { Widget, WidgetBody } from '@@/Widget';
const Context = createContext<null | boolean>(null);
export function useTableContext() {
const context = useContext(Context);
if (context == null) {
throw new Error('Should be nested inside a TableContainer component');
}
}
export function TableContainer({ children }: PropsWithChildren<unknown>) {
return (
<Context.Provider value>
<div className="datatable">
<Widget>
<WidgetBody className="no-padding">{children}</WidgetBody>
</Widget>
</div>
</Context.Provider>
);
}