From 531562d7dff7c7196da41e17ac7ac47c12f1d230 Mon Sep 17 00:00:00 2001 From: "Andika E. Kurnia" <73420758+DikDns@users.noreply.github.com> Date: Thu, 10 Oct 2024 19:48:46 +0700 Subject: [PATCH] fix: add type definition for sponsor and media partner data --- .../common/sponsor-media-section.tsx | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/components/common/sponsor-media-section.tsx b/src/components/common/sponsor-media-section.tsx index d0675c3..cfc6eac 100644 --- a/src/components/common/sponsor-media-section.tsx +++ b/src/components/common/sponsor-media-section.tsx @@ -1,12 +1,16 @@ -import Image from "next/image"; +import Image, { type StaticImageData } from "next/image"; +import LogoAlloBank from "@/assets/sponsors/LogoAlloBank.png"; +import LogoKahf from "@/assets/sponsors/LogoKahf.png"; import { BlurFade } from "@/components/ui/blur-fade"; import { Marquee } from "@/components/ui/marquee"; -import LogoAlloBank from "@/assets/sponsors/LogoAlloBank.png"; -import LogoKahf from "@/assets/sponsors/LogoKahf.png" +type SponsorMediaPartner = { + name: string; + logo: StaticImageData | null; +}; -const sponsorMediaPartners = [ +const sponsorMediaPartners: SponsorMediaPartner[] = [ { name: "PT. PT Paragon Technology and Innovation", logo: LogoKahf, @@ -32,7 +36,11 @@ const sponsorMediaPartners = [ const firstRow = sponsorMediaPartners.slice(0, sponsorMediaPartners.length / 2); const secondRow = sponsorMediaPartners.slice(sponsorMediaPartners.length / 2); -const SponsorMediaPartnerCard = ({ logo }: { logo: string | null }) => { +const SponsorMediaPartnerCard = ({ + logo, +}: { + logo: StaticImageData | null; +}) => { return (
{logo && } @@ -54,7 +62,7 @@ export function SponsorMediaSection() { {firstRow.map((sponsorMediaPartner) => ( ))} @@ -64,7 +72,7 @@ export function SponsorMediaSection() { {secondRow.map((sponsorMediaPartner) => ( ))}