import React from 'react'; import { useTranslation } from 'react-i18next'; import { Button, Group, Text, Badge } from '@mantine/core'; interface AutomationEntryProps { /** Optional title for the automation (usually for custom ones) */ title?: string; /** MUI Icon component for the badge */ badgeIcon?: React.ComponentType; /** Array of tool operation names in the workflow */ operations: string[]; /** Click handler */ onClick: () => void; /** Whether to keep the icon at normal color (for special cases like "Add New") */ keepIconColor?: boolean; } export default function AutomationEntry({ title, badgeIcon: BadgeIcon, operations, onClick, keepIconColor = false }: AutomationEntryProps) { const { t } = useTranslation(); const renderContent = () => { if (title) { // Custom automation with title return ( {BadgeIcon && ( )} {title} ); } else { // Suggested automation showing tool chain return ( {BadgeIcon && ( )} {operations.map((op, index) => ( {String(t(`${op}.title`, op))} {index < operations.length - 1 && ( )} ))} ); } }; return ( ); }