'use client';

import { cn } from '@djangocfg/ui-core/lib';

export interface TreeLabelProps {
  children: React.ReactNode;
  isMatchingSearch?: boolean;
  className?: string;
}

export function TreeLabel({ children, isMatchingSearch, className }: TreeLabelProps) {
  return (
    <span
      style={{ fontSize: 'var(--tree-font-size)' }}
      className={cn(
        'truncate leading-tight tracking-[-0.005em]',
        isMatchingSearch && 'font-medium text-foreground',
        className,
      )}
    >
      {children}
    </span>
  );
}
