From 0e26113d6d9e6da4b186c567bc564d8b072f775d Mon Sep 17 00:00:00 2001 From: jaaaaavier Date: Thu, 28 Nov 2024 16:16:18 +0100 Subject: [PATCH] Typing props --- src/assets/types/have-i-been-pawned.ts | 4 ++-- src/components/monitor/FeatureSection.tsx | 5 ++++- src/components/monitor/PwnedElement.tsx | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/assets/types/have-i-been-pawned.ts b/src/assets/types/have-i-been-pawned.ts index 38a724f55..0ce7dbf05 100644 --- a/src/assets/types/have-i-been-pawned.ts +++ b/src/assets/types/have-i-been-pawned.ts @@ -11,14 +11,14 @@ export interface CtaSection { title: string; description: string; cta: string; - redirect?: string; + redirect: string; } export interface FeatureSection { title: string; description: string; description2: string; - cards: CtaSection[]; + cards: CtaSection; } export interface FeatureSectionV2 { diff --git a/src/components/monitor/FeatureSection.tsx b/src/components/monitor/FeatureSection.tsx index 8091a8a89..29192e1e2 100644 --- a/src/components/monitor/FeatureSection.tsx +++ b/src/components/monitor/FeatureSection.tsx @@ -10,7 +10,10 @@ import Card from '../shared/Card'; export interface FeatureSectionProps { textContent: HaveIbeenPwnedText['FeatureSection']; } -const CardText = ({ textContent }) => { +export interface CardTextProps { + textContent: HaveIbeenPwnedText['FeatureSection']['cards']; +} +const CardText = ({ textContent }: CardTextProps) => { const router = useRouter(); return ( diff --git a/src/components/monitor/PwnedElement.tsx b/src/components/monitor/PwnedElement.tsx index f5c0d998f..bf5d063a1 100644 --- a/src/components/monitor/PwnedElement.tsx +++ b/src/components/monitor/PwnedElement.tsx @@ -29,7 +29,7 @@ const PwnedElementCard: React.FC = ({ textContent }) => { className="text-regular text-base text-gray-80 md:text-lg" dangerouslySetInnerHTML={{ __html: sanitizedHTML }} /> - ; +
{textContent.compromisedData} {textContent.dataClasses.map((dataClass, index) => (