import { isLocalImage, isYoutubeLink } from "@lib/string.ts"; import { IconBrandYoutube } from "@components/icons.tsx"; import { GenericResource } from "@lib/types.ts"; export function Card( { link, title, image, thumbnail, backgroundColor, backgroundSize = 100 }: { backgroundSize?: number; backgroundColor?: string; thumbnail?: string; link?: string; title?: string; image?: string; }, ) { const backgroundStyle = { backgroundSize: "cover", backgroundColor: backgroundColor, }; if (backgroundSize !== 100) { backgroundStyle["backgroundSize"] = `${backgroundSize}%`; backgroundStyle["backgroundRepeat"] = "no-repeat"; backgroundStyle["backgroundPosition"] = "center"; } return ( {true && ( )}
{/* Recipe Card content */}
{isYoutubeLink(link || "") && } {title}
); } export function ResourceCard( { res, sublink = "movies" }: { sublink?: string; res: GenericResource }, ) { const { meta: { image = "/placeholder.svg" } = {} } = res; const imageUrl = isLocalImage(image) ? `/api/images?image=${image}&width=200&height=200` : image; return ( ); }