// Copyright (c) 2026 PowerOn AG
// All rights reserved.
/**
 * Small label for workflow nodes that consume AI credits (LLM calls).
 */

import React from 'react';
import badgeStyles from './AiBadge.module.css';

export interface AiBadgeProps {
  /** Tooltip (e.g. cost / credits hint). */
  title: string;
  /** Canvas nodes: fixed top-right on the node card. */
  variant?: 'canvas' | 'palette';
}

export const AiBadge: React.FC<AiBadgeProps> = ({ title, variant = 'palette' }) => {
  const cls =
    variant === 'canvas'
      ? `${badgeStyles.badge} ${badgeStyles.badgeCanvas}`
      : badgeStyles.badge;
  return (
    <span className={cls} title={title} aria-label={title}>
      AI
    </span>
  );
};
