import { Link } from "react-router-dom"; import { ThemeIcon, Tooltip } from "@mantine/core"; import { IconFileDescription } from "@tabler/icons-react"; import { useTranslation } from "react-i18next"; import { ILabelPageItem } from "@/features/label/types/label.types.ts"; import { LabelChip } from "@/features/label/components/label-chip.tsx"; import { CustomAvatar } from "@/components/ui/custom-avatar.tsx"; import { AvatarIconType } from "@/features/attachments/types/attachment.types.ts"; import { buildPageUrl } from "@/features/page/page.utils"; import { formatLabelListDate } from "@/features/label/utils/format-label-date.ts"; import classes from "@/features/label/label.module.css"; type LabelPageRowProps = { page: ILabelPageItem; currentLabelName: string; }; const MAX_VISIBLE_CHIPS = 3; export function LabelPageRow({ page, currentLabelName }: LabelPageRowProps) { const { t } = useTranslation(); const otherLabels = page.labels.filter((l) => l.name !== currentLabelName); const visibleLabels = otherLabels.slice(0, MAX_VISIBLE_CHIPS); const hiddenLabels = otherLabels.slice(MAX_VISIBLE_CHIPS); return (
{page.icon ? ( {page.icon} ) : ( )}
{page.title || t("Untitled")}
{page.space && ( <> {page.space.name} )} {t("Updated {{date}}", { date: formatLabelListDate(new Date(page.updatedAt)), })}
{/* {otherLabels.length > 0 && (
{visibleLabels.map((label) => ( ))} {hiddenLabels.length > 0 && ( l.name).join(", ")} withArrow openDelay={200} > +{hiddenLabels.length} )}
)} */}
); }