ui-nyla/src/components/FlowEditor/nodes/shared/AiBadge.tsx
ValueOn AG 7eb305f910
Some checks failed
Deploy Nyla Frontend to Integration / deploy (push) Failing after 56s
cp adapted to 2026 poweron
2026-06-09 09:53:38 +02:00

27 lines
710 B
TypeScript

// 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>
);
};