import React from "react"; // headless ui import { Tab } from "@headlessui/react"; // hooks import useLocalStorage from "hooks/use-local-storage"; // components import { SingleProgressStats } from "components/core"; // ui import { Avatar } from "components/ui"; // types import { ICycle } from "types"; // types type Props = { cycle: ICycle; }; export const ActiveCycleProgressStats: React.FC = ({ cycle }) => { const { storedValue: tab, setValue: setTab } = useLocalStorage("activeCycleTab", "Assignees"); const currentValue = (tab: string | null) => { switch (tab) { case "Assignees": return 0; case "Labels": return 1; default: return 0; } }; return ( { switch (i) { case 0: return setTab("Assignees"); case 1: return setTab("Labels"); default: return setTab("Assignees"); } }} > `px-3 py-1 text-brand-base rounded-3xl border border-brand-base ${ selected ? " bg-brand-accent text-white" : " hover:bg-brand-surface-2" }` } > Assignees `px-3 py-1 text-brand-base rounded-3xl border border-brand-base ${ selected ? " bg-brand-accent text-white" : " hover:bg-brand-surface-2" }` } > Labels {cycle.distribution.assignees.map((assignee, index) => { if (assignee.assignee_id) return ( {assignee.first_name} } completed={assignee.completed_issues} total={assignee.total_issues} /> ); else return (
User
No assignee } completed={assignee.completed_issues} total={assignee.total_issues} /> ); })}
{cycle.distribution.labels.map((label, index) => ( {label.label_name ?? "No labels"} } completed={label.completed_issues} total={label.total_issues} /> ))}
); };