import { FinalStep } from '@/types/agent'; import React from 'react'; import { Card, CardContent, Box, Typography } from '@mui/material'; import CheckIcon from '@mui/icons-material/Check'; import CloseIcon from '@mui/icons-material/Close'; import { useAgentStore } from '@/stores/agentStore'; interface FinalStepCardProps { finalStep: FinalStep; isActive?: boolean; } export const FinalStepCard: React.FC = ({ finalStep, isActive = false }) => { const setSelectedStepIndex = useAgentStore((state) => state.setSelectedStepIndex); const isSuccess = finalStep.type === 'success'; const handleClick = () => { // Clicking on final step goes to live mode (null) setSelectedStepIndex(null); }; return ( `${isActive ? isSuccess ? theme.palette.success.main : theme.palette.error.main : theme.palette.divider} !important`, borderRadius: 1.5, transition: 'all 0.2s ease', cursor: 'pointer', boxShadow: isActive ? (theme) => isSuccess ? `0 2px 8px ${theme.palette.mode === 'dark' ? 'rgba(102, 187, 106, 0.3)' : 'rgba(102, 187, 106, 0.2)'}` : `0 2px 8px ${theme.palette.mode === 'dark' ? 'rgba(244, 67, 54, 0.3)' : 'rgba(244, 67, 54, 0.2)'}` : 'none', '&:hover': { borderColor: (theme) => `${isSuccess ? theme.palette.success.main : theme.palette.error.main} !important`, boxShadow: (theme) => isSuccess ? `0 2px 8px ${theme.palette.mode === 'dark' ? 'rgba(102, 187, 106, 0.2)' : 'rgba(102, 187, 106, 0.1)'}` : `0 2px 8px ${theme.palette.mode === 'dark' ? 'rgba(244, 67, 54, 0.2)' : 'rgba(244, 67, 54, 0.1)'}`, }, }} > {/* Header with icon */} {isSuccess ? ( ) : ( )} {isSuccess ? 'Task completed' : 'Task failed'} ); };