mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
refactor(app): move react components to react codebase [EE-3179] (#6971)
This commit is contained in:
parent
212400c283
commit
18252ab854
346 changed files with 642 additions and 644 deletions
44
app/react/components/datatables/TableSettingsMenu.tsx
Normal file
44
app/react/components/datatables/TableSettingsMenu.tsx
Normal file
|
@ -0,0 +1,44 @@
|
|||
import clsx from 'clsx';
|
||||
import { Menu, MenuButton, MenuList } from '@reach/menu-button';
|
||||
import { PropsWithChildren, ReactNode } from 'react';
|
||||
|
||||
import { useTableContext } from './TableContainer';
|
||||
|
||||
interface Props {
|
||||
quickActions?: ReactNode;
|
||||
}
|
||||
|
||||
export function TableSettingsMenu({
|
||||
quickActions,
|
||||
children,
|
||||
}: PropsWithChildren<Props>) {
|
||||
useTableContext();
|
||||
|
||||
return (
|
||||
<Menu className="setting">
|
||||
{({ isExpanded }) => (
|
||||
<>
|
||||
<MenuButton
|
||||
className={clsx('table-setting-menu-btn', {
|
||||
'setting-active': isExpanded,
|
||||
})}
|
||||
>
|
||||
<i className="fa fa-cog" aria-hidden="true" /> Settings
|
||||
</MenuButton>
|
||||
<MenuList>
|
||||
<div className="tableMenu">
|
||||
<div className="menuHeader">Table settings</div>
|
||||
<div className="menuContent">{children}</div>
|
||||
{quickActions && (
|
||||
<div>
|
||||
<div className="menuHeader">Quick actions</div>
|
||||
<div className="menuContent">{quickActions}</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</MenuList>
|
||||
</>
|
||||
)}
|
||||
</Menu>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue