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

28 lines
1.1 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>
2025-07-12 11:17:54 -07:00
<Box display={!isWeb ? 'flex' : undefined} h="65px">
<PlayQueueListControls tableRef={queueRef} type="sideQueue" />
</Box>
2025-07-12 11:17:54 -07:00
<PlayQueue ref={queueRef} type="sideQueue" />
2023-07-01 19:10:05 -07:00
</VirtualGridContainer>
);
2022-12-19 15:59:14 -08:00
};