feishin/src/renderer/features/now-playing/components/sidebar-play-queue.tsx

44 lines
1.5 KiB
TypeScript
Raw Normal View History

2022-12-19 15:59:14 -08:00
import type { AgGridReact as AgGridReactType } from '@ag-grid-community/react/lib/agGridReact';
import { useRef } from 'react';
2022-12-19 15:59:14 -08:00
import { PlayQueueListControls } from './play-queue-list-controls';
import { PageHeader } from '/@/renderer/components/page-header/page-header';
import { VirtualGridContainer } from '/@/renderer/components/virtual-grid';
import { PlayQueue } from '/@/renderer/features/now-playing/components/play-queue';
2023-03-30 06:44:33 -07:00
import { useWindowSettings } from '/@/renderer/store/settings.store';
import { Box } from '/@/shared/components/box/box';
import { Stack } from '/@/shared/components/stack/stack';
2025-05-20 19:23:36 -07:00
import { Song } from '/@/shared/types/domain-types';
import { Platform } from '/@/shared/types/types';
2022-12-31 17:50:05 -08:00
2022-12-19 15:59:14 -08:00
export const SidebarPlayQueue = () => {
const queueRef = useRef<null | { grid: AgGridReactType<Song> }>(null);
2023-07-01 19:10:05 -07:00
const { windowBarStyle } = useWindowSettings();
2022-12-19 15:59:14 -08:00
2023-07-01 19:10:05 -07:00
const isWeb = windowBarStyle === Platform.WEB;
return (
<VirtualGridContainer>
{isWeb && (
<Stack mr={isWeb ? '130px' : undefined}>
<PageHeader />
2023-07-01 19:10:05 -07:00
</Stack>
)}
<Box
2023-07-01 19:10:05 -07:00
display={!isWeb ? 'flex' : undefined}
h={!isWeb ? '65px' : undefined}
>
<PlayQueueListControls
tableRef={queueRef}
type="sideQueue"
/>
</Box>
2023-07-01 19:10:05 -07:00
<PlayQueue
ref={queueRef}
type="sideQueue"
/>
</VirtualGridContainer>
);
2022-12-19 15:59:14 -08:00
};