plane/web/components/issues/issue-layouts/list/headers/state.tsx

32 lines
828 B
TypeScript
Raw Normal View History

2023-10-04 09:59:56 +00:00
// mobx
import { observer } from "mobx-react-lite";
// components
import { HeaderGroupByCard } from "./group-by-card";
import { Icon } from "./state-group";
// store
import { useMobxStore } from "lib/mobx/store-provider";
import { RootStore } from "store/root";
export interface IStateHeader {
column_id: string;
issues_count: number;
}
export const StateHeader: React.FC<IStateHeader> = observer(({ column_id, issues_count }) => {
const { project: projectStore }: RootStore = useMobxStore();
const state = (column_id && projectStore?.getProjectStateById(column_id)) ?? null;
return (
<>
{state && (
<HeaderGroupByCard
icon={<Icon stateGroup={state?.group} color={state?.color} />}
title={state?.name || ""}
count={issues_count}
/>
)}
</>
);
});