* chore: removes replaces 'import type xxx from 'xxx'' with 'import { type xxx} from 'xxx'''
* chore: remove typed imports
* chore: remove typed imports
* chore: cleanup
---------
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
66 lines
1.8 KiB
TypeScript
66 lines
1.8 KiB
TypeScript
import { ReactNode } from 'react';
|
|
|
|
import { useDropdownButton } from '@/ui/dropdown/hooks/useDropdownButton';
|
|
import { TopBar } from '@/ui/top-bar/TopBar';
|
|
|
|
import { FiltersHotkeyScope } from '../types/FiltersHotkeyScope';
|
|
import { ViewsHotkeyScope } from '../types/ViewsHotkeyScope';
|
|
|
|
import { FilterDropdownButton } from './FilterDropdownButton';
|
|
import { SortDropdownButton } from './SortDropdownButton';
|
|
import { UpdateViewButtonGroup } from './UpdateViewButtonGroup';
|
|
import { ViewBarDetails } from './ViewBarDetails';
|
|
import { ViewsDropdownButton } from './ViewsDropdownButton';
|
|
|
|
export type ViewBarProps = {
|
|
className?: string;
|
|
optionsDropdownButton: ReactNode;
|
|
optionsDropdownKey: string;
|
|
};
|
|
|
|
export const ViewBar = ({
|
|
className,
|
|
optionsDropdownButton,
|
|
optionsDropdownKey,
|
|
}: ViewBarProps) => {
|
|
const { openDropdownButton: openOptionsDropdownButton } = useDropdownButton({
|
|
dropdownId: optionsDropdownKey,
|
|
});
|
|
|
|
return (
|
|
<TopBar
|
|
className={className}
|
|
leftComponent={
|
|
<ViewsDropdownButton
|
|
onViewEditModeChange={openOptionsDropdownButton}
|
|
hotkeyScope={{ scope: ViewsHotkeyScope.ListDropdown }}
|
|
/>
|
|
}
|
|
displayBottomBorder={false}
|
|
rightComponent={
|
|
<>
|
|
<FilterDropdownButton
|
|
hotkeyScope={{ scope: FiltersHotkeyScope.FilterDropdownButton }}
|
|
/>
|
|
<SortDropdownButton
|
|
hotkeyScope={{ scope: FiltersHotkeyScope.SortDropdownButton }}
|
|
isPrimaryButton
|
|
/>
|
|
{optionsDropdownButton}
|
|
</>
|
|
}
|
|
bottomComponent={
|
|
<ViewBarDetails
|
|
hasFilterButton
|
|
rightComponent={
|
|
<UpdateViewButtonGroup
|
|
onViewEditModeChange={openOptionsDropdownButton}
|
|
hotkeyScope={ViewsHotkeyScope.CreateDropdown}
|
|
/>
|
|
}
|
|
/>
|
|
}
|
|
/>
|
|
);
|
|
};
|