432fea0ee3
feat: create view from current table columns + persist view fields on Update View button click Closes #1302, Closes #1307
34 lines
958 B
TypeScript
34 lines
958 B
TypeScript
import { DropdownButton } from '@/ui/dropdown/components/DropdownButton';
|
|
import { HotkeyScope } from '@/ui/utilities/hotkey/types/HotkeyScope';
|
|
|
|
import { type TableView } from '../../states/tableViewsState';
|
|
|
|
import { TableOptionsDropdownButton } from './TableOptionsDropdownButton';
|
|
import { TableOptionsDropdownContent } from './TableOptionsDropdownContent';
|
|
|
|
type TableOptionsDropdownProps = {
|
|
onViewsChange?: (views: TableView[]) => void;
|
|
onImport?: () => void;
|
|
customHotkeyScope: HotkeyScope;
|
|
};
|
|
|
|
export function TableOptionsDropdown({
|
|
onViewsChange,
|
|
onImport,
|
|
customHotkeyScope,
|
|
}: TableOptionsDropdownProps) {
|
|
return (
|
|
<DropdownButton
|
|
buttonComponents={<TableOptionsDropdownButton />}
|
|
dropdownHotkeyScope={customHotkeyScope}
|
|
dropdownKey="options"
|
|
dropdownComponents={
|
|
<TableOptionsDropdownContent
|
|
onImport={onImport}
|
|
onViewsChange={onViewsChange}
|
|
/>
|
|
}
|
|
/>
|
|
);
|
|
}
|