"use client"; import { getFileUrl } from "@/shared/utils/file"; import { ArrowRight } from "lucide-react"; import Image from "next/image"; import Link from "next/link"; import DOMPurify from "dompurify"; function truncateHtml(html: string, maxLength: number): string { const tempEl = document.createElement("div"); tempEl.innerHTML = html; const textContent = tempEl.textContent || ""; return textContent.length > maxLength ? textContent.slice(0, maxLength) + "..." : textContent; } export default function NewsCard({ title, description, link, image, }: { title: string; description: string; link: string; image?: string; }) { const safeHtml = DOMPurify.sanitize(truncateHtml(description, 300)); return (