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

37 lines
1.2 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 { 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';
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>
<Box
2023-07-01 19:10:05 -07:00
display={!isWeb ? 'flex' : undefined}
2025-06-24 20:14:15 -07:00
h="65px"
2023-07-01 19:10:05 -07:00
>
<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
};