Files
twenty/front/src/modules/ui/data/data-table/options/components/TableOptionsDropdown.tsx
T
Charles Bochet afd4b7c634 Fix Views on People page (#2265)
* fetching viewId for url

* fixed option menu name input

* fix table import

* fix unnecessary rerenders

* people working

---------

Co-authored-by: bosiraphael <raphael.bosi@gmail.com>
2023-10-27 18:20:58 +02:00

30 lines
1.0 KiB
TypeScript

import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { DropdownScope } from '@/ui/layout/dropdown/scopes/DropdownScope';
import { useView } from '@/views/hooks/useView';
import { TableOptionsDropdownId } from '../../constants/TableOptionsDropdownId';
import { TableOptionsHotkeyScope } from '../../types/TableOptionsHotkeyScope';
import { TableOptionsDropdownButton } from './TableOptionsDropdownButton';
import { TableOptionsDropdownContent } from './TableOptionsDropdownContent';
export const TableOptionsDropdown = ({
onImport,
}: {
onImport?: () => void;
}) => {
const { setViewEditMode } = useView();
return (
<DropdownScope dropdownScopeId={TableOptionsDropdownId}>
<Dropdown
clickableComponent={<TableOptionsDropdownButton />}
dropdownHotkeyScope={{ scope: TableOptionsHotkeyScope.Dropdown }}
dropdownOffset={{ y: 8 }}
dropdownComponents={<TableOptionsDropdownContent onImport={onImport} />}
onClickOutside={() => setViewEditMode('none')}
/>
</DropdownScope>
);
};