"use client"; import { Card, CardContent } from "@/shared/components/ui/card"; import { News } from "@/shared/types/news"; import { ArrowRight } from "lucide-react"; 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; } type Props = { news: News }; export function NewsSecondaryCard({ news }: Props) { const safeHtml = DOMPurify.sanitize(truncateHtml(news.description, 300)); return ( <>
{/*
Pengumuman

12 Oktober 2025

*/}

{news.name}

Baca selengkapnya
); }