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

59 lines
1.4 KiB
TypeScript
Raw Normal View History

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-31 17:50:05 -08:00
import { Flex } from '@mantine/core';
2022-12-19 15:59:14 -08:00
import { PlayQueue } from '/@/renderer/features/now-playing/components/play-queue';
2022-12-31 17:50:05 -08:00
import styled from 'styled-components';
2022-12-19 15:59:14 -08:00
import { PlayQueueListControls } from './play-queue-list-controls';
import { Song } from '/@/renderer/api/types';
2022-12-31 17:50:05 -08:00
const BackgroundImageOverlay = styled.div`
position: absolute;
top: 0;
left: 0;
z-index: 10;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 30%), var(--background-noise);
`;
2022-12-19 15:59:14 -08:00
export const SidebarPlayQueue = () => {
const queueRef = useRef<{ grid: AgGridReactType<Song> } | null>(null);
return (
2022-12-31 17:50:05 -08:00
<>
<Flex
bg="var(--titlebar-bg)"
h="65px"
2022-12-31 17:50:05 -08:00
sx={{ position: 'relative' }}
w="100%"
>
<BackgroundImageOverlay />
<Flex
h="100%"
mr="160px"
sx={{
WebkitAppRegion: 'drag',
background: 'var(--titlebar-bg)',
}}
w="100%"
/>
</Flex>
<Flex
direction="column"
h="calc(100% - 65px)"
2022-12-31 17:50:05 -08:00
sx={{ borderLeft: '2px solid var(--generic-border-color)' }}
w="100%"
>
<PlayQueue
ref={queueRef}
type="sideQueue"
/>
<PlayQueueListControls
tableRef={queueRef}
type="sideQueue"
/>
</Flex>
</>
2022-12-19 15:59:14 -08:00
);
};