diff --git a/app/vip/components/dashboard/TopicCards.tsx b/app/vip/components/dashboard/TopicCards.tsx index 7c375eb..fdc6c7e 100644 --- a/app/vip/components/dashboard/TopicCards.tsx +++ b/app/vip/components/dashboard/TopicCards.tsx @@ -4,6 +4,8 @@ import Link from "next/link"; import { TOPICS } from "@/app/data/vip.mock"; import styles from "../vip.module.css"; +type TopicItem = (typeof TOPICS)[number]; + export function TopicCards() { return (
@@ -12,7 +14,8 @@ export function TopicCards() { className={`${styles.topicGrid} animate__animated animate__fadeInUp`} style={{ animationDelay: "0.2s", animationFillMode: "both" }} > - {TOPICS.map((t) => { + {TOPICS.map((t: TopicItem) => { + const { id, href } = t; const content = ( <> {t.icon} @@ -20,21 +23,18 @@ export function TopicCards() { {t.desc} ); - if (t.href) { - return ( - - {content} - - ); - } - return ( -
+ return href ? ( + + {content} + + ) : ( +
{content}
); diff --git a/app/vip/components/landing/TopicEbookShowcase.tsx b/app/vip/components/landing/TopicEbookShowcase.tsx index 834f525..868c353 100644 --- a/app/vip/components/landing/TopicEbookShowcase.tsx +++ b/app/vip/components/landing/TopicEbookShowcase.tsx @@ -18,6 +18,7 @@ export function TopicEbookShowcase({ onLockedClick }: TopicEbookShowcaseProps) { style={{ animationDelay: "0.2s", animationFillMode: "both", marginBottom: "1.5rem" }} > {TOPICS_DISPLAY.map((t) => { + const { id, href } = t; const isLocked = "locked" in t && t.locked && onLockedClick; const content = ( @@ -32,7 +33,7 @@ export function TopicEbookShowcase({ onLockedClick }: TopicEbookShowcaseProps) { if (isLocked) { return (