/** * 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"; import { LabelPropertyIcon } from "@plane/propel/icons"; // plane imports import { Tooltip } from "@plane/propel/tooltip"; // hooks import { useLabel } from "@/hooks/store/use-label"; type Props = { labelIds: string[]; shouldShowLabel?: boolean; }; export const IssueBlockLabels = observer(function IssueBlockLabels({ labelIds, shouldShowLabel = false }: Props) { const { getLabelsByIds } = useLabel(); const labels = getLabelsByIds(labelIds); const labelsString = labels.length > 0 ? labels.map((label) => label.name).join(", ") : "No Labels"; if (labels.length <= 0) return (
{shouldShowLabel && No Labels}
); return (
{labels.length <= 2 ? ( <> {labels.map((label) => (
{label?.name}
))} ) : (
{`${labels.length} Labels`}
)}
); });