/** * Copyright (c) 2023-present Plane Software, Inc. and contributors * SPDX-License-Identifier: AGPL-3.0-only * See the LICENSE file for details. */ import { observer } from "mobx-react"; // plane ui import { StateGroupIcon } from "@plane/propel/icons"; import { Tooltip } from "@plane/propel/tooltip"; import type { TStateGroups } from "@plane/types"; // plane utils import { cn } from "@plane/utils"; //hooks import { useStates } from "@/hooks/store/use-state"; type Props = { shouldShowBorder?: boolean; } & ( | { stateDetails: { name: string; group: TStateGroups; }; } | { stateId: string; } ); export const IssueBlockState = observer(function IssueBlockState(props: Props) { const { shouldShowBorder = true } = props; // store hooks const { getStateById } = useStates(); // derived values const state = "stateId" in props ? getStateById(props.stateId) : props.stateDetails; if (!state) return null; return (
{state.name}
); });