import { Stack, Group, Grid, Accordion, Center } from '@mantine/core'; import { SpotlightProvider } from '@mantine/spotlight'; import { AnimatePresence, motion } from 'framer-motion'; import { BsCollection } from 'react-icons/bs'; import { Button, TextInput } from '/@/renderer/components'; import { RiAlbumLine, RiArrowDownSLine, RiArrowLeftSLine, RiArrowRightSLine, RiDatabaseLine, RiDiscLine, RiEyeLine, RiFolder3Line, RiHome5Line, RiMusicLine, RiPlayListLine, RiSearchLine, RiUserVoiceLine, } from 'react-icons/ri'; import { useNavigate, Link } from 'react-router-dom'; import styled from 'styled-components'; import { SidebarItem } from '/@/renderer/features/sidebar/components/sidebar-item'; import { AppRoute } from '/@/renderer/router/routes'; import { useSidebarStore, useAppStoreActions, useCurrentSong } from '/@/renderer/store'; import { fadeIn } from '/@/renderer/styles'; const SidebarContainer = styled.div` height: 100%; max-height: calc(100vh - 85px); // Account for and playerbar user-select: none; `; const ImageContainer = styled(motion(Link))<{ height: string }>` position: relative; height: ${(props) => props.height}; ${fadeIn}; animation: fadein 0.2s ease-in-out; button { display: none; } &:hover button { display: block; } `; const SidebarImage = styled.img` width: 100%; height: 100%; object-fit: cover; background: var(--placeholder-bg); `; const ActionsContainer = styled(Grid)` -webkit-app-region: drag; `; export const Sidebar = () => { const navigate = useNavigate(); const sidebar = useSidebarStore(); const { setSidebar } = useAppStoreActions(); const imageUrl = useCurrentSong()?.imageUrl; const showImage = sidebar.image; return ( } placeholder="Search" rightSectionWidth={90} // onClick={() => openSpotlight()} /> Home Explore setSidebar({ expanded: e })} > Library Albums Tracks Artists Folders Collections Playlists {showImage && ( {imageUrl ? ( ) : (
)}
)}
); };