import { AnimatePresence, motion } from 'framer-motion'; import { classNames } from '~/utils/classNames'; import type { DeployAlert } from '~/types/actions'; interface DeployAlertProps { alert: DeployAlert; clearAlert: () => void; postMessage: (message: string) => void; } export default function DeployChatAlert({ alert, clearAlert, postMessage }: DeployAlertProps) { const { type, title, description, content, url, stage, buildStatus, deployStatus } = alert; // Determine if we should show the deployment progress const showProgress = stage && (buildStatus || deployStatus); return (
{/* Icon */}
{/* Content */}
{title}

{description}

{/* Deployment Progress Visualization */} {showProgress && (
{/* Build Step */}
{buildStatus === 'running' ? (
) : buildStatus === 'complete' ? (
) : buildStatus === 'failed' ? (
) : ( 1 )}
Build
{/* Connector Line */}
{/* Deploy Step */}
{deployStatus === 'running' ? (
) : deployStatus === 'complete' ? (
) : deployStatus === 'failed' ? (
) : ( 2 )}
Deploy
)} {content && (
{content}
)} {url && type === 'success' && ( )}
{/* Actions */}
{type === 'error' && ( )}
); }