diff --git a/aimenet-web/src/pages/card-manager.tsx b/aimenet-web/src/pages/card-manager.tsx index e4bfe11..ba5e35a 100644 --- a/aimenet-web/src/pages/card-manager.tsx +++ b/aimenet-web/src/pages/card-manager.tsx @@ -1,6 +1,6 @@ +import {Server, Trash} from "lucide-react"; import {useNavigate} from "react-router-dom"; import {useLiveQuery} from "dexie-react-hooks"; -import {Plus, Server, Trash} from "lucide-react"; import {AimeCard, db} from "@/lib/database"; @@ -20,39 +20,24 @@ import {CardCreationDialog} from "@/components/card-creation-form"; import {IncognitoStorageWarning} from "@/components/incognito-warning"; import {NoCardsNotification} from "@/components/no-cards-notification"; -function CardAddButton() { +function CardList(props: { cards: AimeCard[] | undefined }) { return (<> - - - - ); -} + -function CardList(props: { cards: AimeCard[] | undefined }) { - if (!props.cards?.length) { - return (<> - - - ); - } - - return (<> - - - {props.cards.map(s => - - - - - - db.cards.delete(s.id)}> - Remove - - - )} + {!props.cards?.length + ? + : props.cards.map(s => + + + + + + db.cards.delete(s.id)}> + Remove + + + )} ); }