@kinvolk/headlamp-plugin
Version:
The needed infrastructure for building Headlamp plugins.
14 lines (13 loc) • 999 B
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { CreateResourceButton } from '../CreateResourceButton';
import SectionBox from '../SectionBox';
import SectionFilterHeader from '../SectionFilterHeader';
import ResourceTable from './ResourceTable';
export default function ResourceListView(props) {
const { title, children, headerProps, ...tableProps } = props;
const withNamespaceFilter = 'resourceClass' in props && props.resourceClass?.isNamespaced;
const resourceClass = props
.resourceClass;
return (_jsxs(SectionBox, { title: typeof title === 'string' ? (_jsx(SectionFilterHeader, { title: title, noNamespaceFilter: !withNamespaceFilter, titleSideActions: headerProps?.titleSideActions ||
(resourceClass ? [_jsx(CreateResourceButton, { resourceClass: resourceClass })] : undefined), ...headerProps })) : (title), children: [_jsx(ResourceTable, { enableRowActions: true, enableRowSelection: true, ...tableProps }), children] }));
}