"use client"; import { FC } from "react"; import Link from "next/link"; // types import { ICycle, TCycleGroups } from "@plane/types"; // ui import { Tooltip, CycleGroupIcon, getButtonStyling, Avatar, AvatarGroup } from "@plane/ui"; // helpers import { renderFormattedDate, findHowManyDaysLeft } from "@/helpers/date-time.helper"; import { truncateText } from "@/helpers/string.helper"; // hooks import { useMember } from "@/hooks/store"; export type ActiveCycleHeaderProps = { cycle: ICycle; workspaceSlug: string; projectId: string; }; export const ActiveCycleHeader: FC = (props) => { const { cycle, workspaceSlug, projectId } = props; // store const { getUserDetails } = useMember(); const cycleOwnerDetails = cycle && cycle.owned_by_id ? getUserDetails(cycle.owned_by_id) : undefined; const daysLeft = findHowManyDaysLeft(cycle.end_date) ?? 0; const currentCycleStatus = cycle.status?.toLocaleLowerCase() as TCycleGroups | undefined; const cycleAssignee = (cycle.distribution?.assignees ?? []).filter((assignee) => assignee.display_name); return (

{truncateText(cycle.name, 70)}

{`${daysLeft} ${daysLeft > 1 ? "days" : "day"} left`}
{cycleAssignee.length > 0 && ( {cycleAssignee.map((member) => ( ))} )}
View Cycle
); };