2022-12-19 15:59:14 -08:00
|
|
|
import type { AgGridReact as AgGridReactType } from '@ag-grid-community/react/lib/agGridReact';
|
2025-05-18 14:03:18 -07:00
|
|
|
|
|
|
|
|
import { useRef } from 'react';
|
|
|
|
|
|
2022-12-19 15:59:14 -08:00
|
|
|
import { PlayQueueListControls } from './play-queue-list-controls';
|
2025-05-18 14:03:18 -07:00
|
|
|
|
|
|
|
|
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';
|
2025-06-24 00:04:36 -07:00
|
|
|
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 = () => {
|
2025-05-18 14:03:18 -07:00
|
|
|
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" />
|
2025-06-24 00:04:36 -07:00
|
|
|
</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
|
|
|
};
|