import React from "react"; // hooks import useIssuesView from "hooks/use-issues-view"; // icons import { ArrowsPointingInIcon, ArrowsPointingOutIcon, PlusIcon } from "@heroicons/react/24/outline"; import { getStateGroupIcon } from "components/icons"; // helpers import { addSpaceIfCamelCase } from "helpers/string.helper"; // types import { IState } from "types"; type Props = { currentState?: IState | null; groupTitle: string; addIssueToState: () => void; isCollapsed: boolean; setIsCollapsed: React.Dispatch>; }; export const BoardHeader: React.FC = ({ currentState, groupTitle, addIssueToState, isCollapsed, setIsCollapsed, }) => { const { groupedByIssues, groupByProperty: selectedGroup } = useIssuesView(); let bgColor = "#000000"; if (selectedGroup === "state") bgColor = currentState?.color ?? "#000000"; if (selectedGroup === "priority") groupTitle === "high" ? (bgColor = "#dc2626") : groupTitle === "medium" ? (bgColor = "#f97316") : groupTitle === "low" ? (bgColor = "#22c55e") : (bgColor = "#ff0000"); return (
{currentState && getStateGroupIcon(currentState.group, "18", "18", bgColor)}

{selectedGroup === "state" ? addSpaceIfCamelCase(currentState?.name ?? "") : addSpaceIfCamelCase(groupTitle)}

{groupedByIssues?.[groupTitle].length ?? 0}
); };