import { ActionIcon, Button, Group, Overlay, ScrollArea, Stack, Text, } from '@mantine/core'; import { useDisclosure } from '@mantine/hooks'; import { useCommonHooks } from 'hooks'; import { useState } from 'react'; import { FiEdit, FiTrash } from 'react-icons/fi'; import { scrollAreaClasses } from 'styles'; import type { Theme, ThemePlaylist } from 'types'; import DeleteItemModal from '../Shared/DeleteItemModal'; import ThemeMiniCard from './ThemeMiniCard'; function ThemePlaylistCard({ cardPlaylist, handleOpen, allThemes, }: { cardPlaylist: any; handleOpen: (cardPlaylist: ThemePlaylist) => void; allThemes: Theme[]; }) { const [hover, setHover] = useState(false); const { setThemeName, setCurrentThemePlaylist, theme, handleDelete } = useCommonHooks(); const defaultLists = ['All', 'Backgrounds', 'No Backgrounds']; const [modalOpened, { open: openModal, close: closeModal }] = useDisclosure(false); const themeList = JSON.parse( cardPlaylist?.themeList?.name === 'Time of Day' ? '[]' : cardPlaylist.themeList, ); return ( setHover(true)} onMouseLeave={() => setHover(false)} > handleDelete(cardPlaylist, 'api/themePlaylists')} title='Delete Theme Playlist' body={ Are you sure you want to delete this Theme Playlist? {`"${cardPlaylist.name}"`} This action cannot be undone! } /> {cardPlaylist.name} {!defaultLists.includes(cardPlaylist.name) && ( { handleOpen(cardPlaylist); }} > )} {cardPlaylist.default === 0 && ( { openModal(); }} > )} ); } export default ThemePlaylistCard;