Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

759 B
Raw Blame
import { useTranslation } from "react-i18next";
import { HighlightLabelText } from "@/components/HighlightLabelText";
import type { SQLEditorTreeNode } from "@/types";

type Props = {
  readonly node: SQLEditorTreeNode;
  readonly keyword: string;
};

export function LabelNode({ node, keyword }: Props) {
  const { t } = useTranslation();
  const label = (node as SQLEditorTreeNode<"label">).meta.target;

  return (
    <div className="truncate">
      <span>{label.key}</span>
      <span className="mr-0.5">:</span>
      {label.value ? (
        <HighlightLabelText text={label.value} keyword={keyword} />
      ) : (
        <span className="text-control-placeholder">
          {t("label.empty-label-value")}
        </span>
      )}
    </div>
  );
}