import Image from "next/image"; import Link from "next/link"; import type { Locale } from "@/lib/i18n"; import { getMelodyPath } from "@/lib/melody-content"; import AudioPlayer from "@/components/public/audio-player"; type MelodyCardProps = { locale: Locale; melody: { slug: string; id: string; titleAr: string; titleEn: string; descAr: string | null; descEn: string | null; audioFile: string; coverImage: string | null; isDownloadable: boolean; category: { nameAr: string; nameEn: string }; }; }; export default function MelodyCard({ locale, melody }: MelodyCardProps) { const title = locale === "ar" ? melody.titleAr : melody.titleEn; const description = locale === "ar" ? melody.descAr : melody.descEn; const category = locale === "ar" ? melody.category.nameAr : melody.category.nameEn; return (
{melody.coverImage ? {title} : null}

{category}

{title}

{description ?

{description}

: null}
); }