diff --git a/src/components/landing-page/TranscriptCard.tsx b/src/components/landing-page/TranscriptCard.tsx index e8cbfe4..9f2c5e5 100644 --- a/src/components/landing-page/TranscriptCard.tsx +++ b/src/components/landing-page/TranscriptCard.tsx @@ -1,33 +1,27 @@ import React from "react"; -import Link from "next/link"; import { MicIcon } from "@bitcoin-dev-project/bdp-ui/icons"; import { Transcript } from "../../../.contentlayer/generated/types"; import { createSlug } from "@/utils"; -import SourceCountData from "@/public/source-count-data.json"; interface TranscriptCardProps { data: Transcript; daysOpened?: number; transcripts?: number; + source: string; } -const TranscriptCard = ({ data, daysOpened, transcripts }: TranscriptCardProps) => { +const TranscriptCard = ({ data, daysOpened, transcripts, source }: TranscriptCardProps) => { const remainingSpeakers = data?.speakers?.length && data?.speakers.length > 2 ? data?.speakers.length - 2 : 0; - const mappedKeyToName = SourceCountData.find((source) => source.slug === data.slugAsParams[0])?.name; - return ( -
-

- {mappedKeyToName ?? data.slugAsParams[0]} -

-
+

{source}

+

{data?.title}

{daysOpened ?

{daysOpened} days ago

: null}
@@ -64,7 +58,7 @@ const TranscriptCard = ({ data, daysOpened, transcripts }: TranscriptCardProps) ) : null}
)} - + ); }; diff --git a/src/components/landing-page/featured-transcripts/FeaturedTranscriptClient.tsx b/src/components/landing-page/featured-transcripts/FeaturedTranscriptClient.tsx index bc66dd6..176110e 100644 --- a/src/components/landing-page/featured-transcripts/FeaturedTranscriptClient.tsx +++ b/src/components/landing-page/featured-transcripts/FeaturedTranscriptClient.tsx @@ -3,6 +3,7 @@ import React, { useState } from "react"; import { Transcript } from "contentlayer/generated"; import { DiceIcon } from "@bitcoin-dev-project/bdp-ui/icons"; +import SourceCountData from "@/public/source-count-data.json"; import TranscriptCard from "../TranscriptCard"; const FeaturedTranscriptClient = ({ @@ -18,6 +19,9 @@ const FeaturedTranscriptClient = ({ setFeatured([...featuredTranscripts].sort(() => 0.5 - Math.random())); }; + const getSourceFromTranscript = (data: Transcript) => + SourceCountData.find((source) => source.slug === data.slugAsParams[0])?.name ?? (data.slugAsParams as Array)[0]; + return (
@@ -32,7 +36,7 @@ const FeaturedTranscriptClient = ({
{featured.slice(0, 3).map((transcript, idx) => ( - + ))}
@@ -41,7 +45,7 @@ const FeaturedTranscriptClient = ({

Latest Transcripts

{latestTranscripts.map((transcript, idx) => ( - + ))}