import { Link } from "@/shared/config/navigation"; import { Title } from "@/shared/ui"; import Image, { StaticImageData } from "next/image"; interface INewsCard { id: number; image: StaticImageData | string; title: string; content: string; date: string; } const NewsCard = ({ id, image, title, content, date }: INewsCard) => { const sliceTitle = (title: string) => { if (title.length > 35) { return `${title.slice(0, 35)}...`; } return title; }; const sliceDescription = (content: string) => { if (content.length > 65) { return `${content.slice(0, 65)}...`; } return content; }; const sliceDate = (date: string) => { return `${date.slice(8, 10)}/${date.slice(5, 7)}/${date.slice(0, 4)}`; }; return (
Card image <p className="leading-6 text-gray-600 mb-[46px]"> {sliceDescription(content)} </p> <p className="text-[14px] text-gray-600">{sliceDate(date)}</p> </Link> </div> ); }; export default NewsCard;