2022-12-19 15:59:14 -08:00
|
|
|
import { useRef } from 'react';
|
|
|
|
|
import type { AgGridReact as AgGridReactType } from '@ag-grid-community/react/lib/agGridReact';
|
2022-12-27 13:56:37 -08:00
|
|
|
import { Flex, Stack } from '@mantine/core';
|
2022-12-19 15:59:14 -08:00
|
|
|
import { NowPlayingHeader } from '/@/renderer/features/now-playing/components/now-playing-header';
|
|
|
|
|
import { PlayQueue } from '/@/renderer/features/now-playing/components/play-queue';
|
|
|
|
|
import { PlayQueueListControls } from '/@/renderer/features/now-playing/components/play-queue-list-controls';
|
|
|
|
|
import type { Song } from '/@/renderer/api/types';
|
|
|
|
|
import { AnimatedPage } from '/@/renderer/features/shared';
|
|
|
|
|
|
|
|
|
|
const NowPlayingRoute = () => {
|
|
|
|
|
const queueRef = useRef<{ grid: AgGridReactType<Song> } | null>(null);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<AnimatedPage>
|
|
|
|
|
<Stack
|
2022-12-27 13:56:37 -08:00
|
|
|
h="100%"
|
2022-12-19 15:59:14 -08:00
|
|
|
spacing={0}
|
|
|
|
|
>
|
|
|
|
|
<NowPlayingHeader />
|
|
|
|
|
<PlayQueue
|
|
|
|
|
ref={queueRef}
|
|
|
|
|
type="nowPlaying"
|
|
|
|
|
/>
|
2022-12-27 13:56:37 -08:00
|
|
|
<Flex sx={{ borderTop: '1px solid var(--generic-border-color)' }}>
|
|
|
|
|
<PlayQueueListControls
|
|
|
|
|
tableRef={queueRef}
|
|
|
|
|
type="nowPlaying"
|
|
|
|
|
/>
|
|
|
|
|
</Flex>
|
2022-12-19 15:59:14 -08:00
|
|
|
</Stack>
|
|
|
|
|
</AnimatedPage>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default NowPlayingRoute;
|