import { FC } from "react"; import { observer } from "mobx-react"; import Link from "next/link"; import { Circle, Info, Lock, Minus, Star, UsersRound } from "lucide-react"; import { Avatar, TOAST_TYPE, Tooltip, setToast } from "@plane/ui"; // components import { PageQuickActions } from "@/components/pages"; // helpers import { cn } from "@/helpers/common.helper"; import { renderFormattedDate } from "@/helpers/date-time.helper"; // hooks import { useMember, usePage } from "@/hooks/store"; type TPageListBlock = { workspaceSlug: string; projectId: string; pageId: string; }; export const PageListBlock: FC = observer((props) => { const { workspaceSlug, projectId, pageId } = props; // hooks const { access, created_at, is_favorite, name, owned_by, addToFavorites, removeFromFavorites } = usePage(pageId); const { getUserDetails } = useMember(); // derived values const ownerDetails = owned_by ? getUserDetails(owned_by) : undefined; const handleFavorites = () => { if (is_favorite) removeFromFavorites().then(() => setToast({ type: TOAST_TYPE.SUCCESS, title: "Success!", message: "Page removed from favorites.", }) ); else addToFavorites().then(() => setToast({ type: TOAST_TYPE.SUCCESS, title: "Success!", message: "Page added to favorites.", }) ); }; return ( {/* page title */}
{name}
{/* page properties */}
{/* page details */}
{/* Labels */}
{/* 10m read */}
{access === 0 ? : }
{/* vertical divider */} {/* page info */} {/* favorite/unfavorite */} {/* quick actions dropdown */}
); });