mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-04 11:03:27 +00:00
[ENG-701] Add explorer top bar options to tags (#918)
Add top bar options
This commit is contained in:
parent
007e089fcf
commit
f3a35a9c13
|
@ -1,7 +1,9 @@
|
|||
import { z } from 'zod';
|
||||
import { useLibraryQuery } from '@sd/client';
|
||||
import { useZodRouteParams } from '~/hooks';
|
||||
import { useExplorerTopBarOptions, useZodRouteParams } from '~/hooks';
|
||||
import Explorer from '../Explorer';
|
||||
import { TopBarPortal } from '../TopBar/Portal';
|
||||
import TopBarOptions from '../TopBar/TopBarOptions';
|
||||
|
||||
const PARAMS = z.object({
|
||||
id: z.coerce.number()
|
||||
|
@ -10,6 +12,8 @@ const PARAMS = z.object({
|
|||
export const Component = () => {
|
||||
const { id } = useZodRouteParams(PARAMS);
|
||||
|
||||
const topBarOptions = useExplorerTopBarOptions();
|
||||
|
||||
const explorerData = useLibraryQuery([
|
||||
'search.objects',
|
||||
{
|
||||
|
@ -20,8 +24,19 @@ export const Component = () => {
|
|||
]);
|
||||
|
||||
return (
|
||||
<div className="w-full">
|
||||
<>
|
||||
<TopBarPortal
|
||||
right={
|
||||
<TopBarOptions
|
||||
options={[
|
||||
topBarOptions.explorerViewOptions,
|
||||
topBarOptions.explorerToolOptions,
|
||||
topBarOptions.explorerControlOptions
|
||||
]}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
{explorerData.data && <Explorer items={explorerData.data.items} />}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue