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
|
|
|
|
2025-06-24 00:04:36 -07:00
|
|
|
import { PageHeader } from '/@/renderer/components/page-header/page-header';
|
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';
|
|
|
|
|
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 = () => {
|
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>
|
|
|
|
|
{isWeb && (
|
|
|
|
|
<Stack mr={isWeb ? '130px' : undefined}>
|
2025-06-24 00:04:36 -07:00
|
|
|
<PageHeader />
|
2023-07-01 19:10:05 -07:00
|
|
|
</Stack>
|
|
|
|
|
)}
|
2025-06-24 00:04:36 -07:00
|
|
|
<Box
|
2023-07-01 19:10:05 -07:00
|
|
|
display={!isWeb ? 'flex' : undefined}
|
|
|
|
|
h={!isWeb ? '65px' : undefined}
|
|
|
|
|
>
|
|
|
|
|
<PlayQueueListControls
|
|
|
|
|
tableRef={queueRef}
|
|
|
|
|
type="sideQueue"
|
|
|
|
|
/>
|
2025-06-24 00:04:36 -07:00
|
|
|
</Box>
|
2023-07-01 19:10:05 -07:00
|
|
|
<PlayQueue
|
|
|
|
|
ref={queueRef}
|
|
|
|
|
type="sideQueue"
|
|
|
|
|
/>
|
|
|
|
|
</VirtualGridContainer>
|
|
|
|
|
);
|
2022-12-19 15:59:14 -08:00
|
|
|
};
|