diff --git a/app/components/FeaturedMedium.tsx b/app/components/FeaturedMedium.tsx index 565435a..32a3d80 100644 --- a/app/components/FeaturedMedium.tsx +++ b/app/components/FeaturedMedium.tsx @@ -1,19 +1,16 @@ +import type { ESPlace } from "~/esTypes"; import VideoEmbed from "./VideoEmbed"; -import type { TRelatedCoreDataRecords } from "~/types"; interface Props { - record: TRelatedCoreDataRecords; + record: ESPlace; } const FeaturedMedium = ({ record }: Props) => { - if (!record.items || !record.media_contents) return null; - if (record.items?.videos) { - return ; + if (record.featured_video) { + return ; } - if (record.media_contents?.photographs) { - return ( - - ); + if (record.featured_photograph) { + return ; } return <>; }; diff --git a/app/components/VideoEmbed.tsx b/app/components/VideoEmbed.tsx index 7a3c868..ce48541 100644 --- a/app/components/VideoEmbed.tsx +++ b/app/components/VideoEmbed.tsx @@ -1,32 +1,16 @@ -import { useMemo, useState } from "react"; -import type { TVideoItem } from "../types"; +import type { ESVideo } from "~/esTypes"; interface Props { - video: TVideoItem; + video: ESVideo; } const VideoEmbed = ({ video }: Props) => { - const [embedSrc, setEmbedSrc] = useState(undefined); - - useMemo(() => { - switch (video.provider) { - case "Vimeo": - setEmbedSrc(`https://player.vimeo.com/video/${video.embed_id}`); - break; - case "YouTube": - setEmbedSrc(`https://www.youtube.com/embed/${video.embed_id}`); - default: - break; - } - return; - }, [video]); - return (