/**
 * Copyright (c) 2023-present Pi Dash Software, Inc. and contributors
 * SPDX-License-Identifier: AGPL-3.0-only
 * See the LICENSE file for details.
 */

import { Tooltip } from "@pi-dash/propel/tooltip";

type TIssueLabelPill = { name?: string; color?: string };

export function LabelActivityChip(props: TIssueLabelPill) {
  const { name, color } = props;
  return (
    <Tooltip tooltipContent={name}>
      <span className="inline-flex w-min max-w-32 flex-shrink-0 cursor-default items-center gap-2 truncate rounded-full border border-strong px-2 py-0.5 text-11 whitespace-nowrap">
        <span
          className="h-1.5 w-1.5 flex-shrink-0 rounded-full"
          style={{
            backgroundColor: color ?? "#000000",
          }}
          aria-hidden="true"
        />
        <span className="flex-shrink truncate font-medium text-primary">{name}</span>
      </span>
    </Tooltip>
  );
}
