import styles from "./ItemDetail.module.css"; import { RingBadge } from "@/components/Badge/Badge"; import { Attention, Edit } from "@/components/Icons"; import { Tag } from "@/components/Tags/Tags"; import { getEditUrl, getLabel, getReleases } from "@/lib/data"; import { Item } from "@/lib/types"; import { cn } from "@/lib/utils"; const latestReleases = getReleases().slice(-3); function isNotMaintained(release: string) { return !latestReleases.includes(release); } interface ItemProps { item: Item; } export function ItemDetail({ item }: ItemProps) { const notMaintainedText = getLabel("notUpdated"); return ( <>

{item.title}

{item.tags?.map((tag) => )}
{notMaintainedText && isNotMaintained(item.release) && (
{notMaintainedText}
)} {item.revisions?.map((revision, index) => ( ))}
); } interface RevisionProps { id: string; release: string; ring: string; body?: string; } function Revision({ id, release, ring, body }: RevisionProps) { const date = new Date(release); const editLink = getEditUrl({ id, release }); const formattedDate = date.toLocaleDateString("en-US", { month: "short", year: "numeric", }); return (
{body ?
: null} {editLink && ( )}
); }