More typing

This commit is contained in:
2025-04-15 22:16:27 -05:00
parent 78dec160b6
commit 4e9df7256b
27 changed files with 235 additions and 110 deletions

View File

@@ -4,10 +4,20 @@ import { useCommonHooks, useMutationAPI } from 'hooks';
import { useState } from 'react';
import { FiEdit, FiShuffle, FiTrash, FiX } from 'react-icons/fi';
import { actionIconClasses } from 'styles';
import type { ThemePlaylist } from 'types';
import type { Theme, ThemePlaylist } from 'types';
import DeleteItemModal from '../Shared/DeleteItemModal';
function ThemeCard({ cardTheme, handleOpen, allThemes, themePlaylists }: any) {
function ThemeCard({
cardTheme,
handleOpen,
allThemes,
themePlaylists,
}: {
cardTheme: Theme;
handleOpen: (cardTheme: Theme) => void;
allThemes: Theme[];
themePlaylists: any;
}) {
const [hover, setHover] = useState(false);
const [shiftEdit, setShiftEdit] = useState<number>(0);
const [shiftShuffle, setShiftShuffle] = useState<number>(0);
@@ -263,11 +273,11 @@ function ThemeCard({ cardTheme, handleOpen, allThemes, themePlaylists }: any) {
<FiShuffle
onClick={() => {
const themeList = JSON.parse(
themePlaylists.find(
themePlaylists?.find(
(t: ThemePlaylist) => t.name === currentThemePlaylist,
).themeList,
);
const filteredThemes = allThemes.filter((t: any) =>
const filteredThemes = allThemes.filter((t: Theme) =>
themeList.includes(t.id),
);
handleThemeChange(filteredThemes, false);