import React from "react"; import Link from "next/link"; import { useRouter } from "next/router"; import dynamic from "next/dynamic"; // ui import { CustomMenu, Loader } from "components/ui"; // icons import { PencilIcon, StarIcon, TrashIcon } from "@heroicons/react/24/outline"; // helpers import { truncateText } from "helpers/string.helper"; import { renderShortTime } from "helpers/date-time.helper"; // types import { IPage } from "types"; type TSingleStatProps = { page: IPage; handleEditPage: () => void; handleDeletePage: () => void; handleAddToFavorites: () => void; handleRemoveFromFavorites: () => void; }; const RemirrorRichTextEditor = dynamic(() => import("components/rich-text-editor"), { ssr: false, loading: () => ( ), }); export const SinglePageDetailedItem: React.FC = ({ page, handleEditPage, handleDeletePage, handleAddToFavorites, handleRemoveFromFavorites, }) => { const router = useRouter(); const { workspaceSlug, projectId } = router.query; return ( {truncateText(page.name, 75)} {page.label_details.length > 0 && page.label_details.map((label) => ( {label.name} ))} {renderShortTime(page.updated_at)} {page.is_favorite ? ( ) : ( )} Edit Page Delete Page {page.blocks.length > 0 ? ( ) : null} ); };
{truncateText(page.name, 75)}
{renderShortTime(page.updated_at)}