'use client'; interface StatusDisplayProps { status: 'idle' | 'creating' | 'success' | 'error'; txHash?: string; recordId?: string; appRecordId?: string; lrn?: string; dns?: string; appName?: string; repoUrl?: string; commitHash?: string; shortCommitHash?: string; error?: string; } export default function StatusDisplay({ status, txHash, recordId, appRecordId, lrn, dns, appName, repoUrl, commitHash, shortCommitHash, error, }: StatusDisplayProps) { // Get domain suffix from environment variable const domainSuffix = process.env.NEXT_PUBLIC_DOMAIN_SUFFIX; if (status === 'idle') return null; const StatusBadge = ({ type }: { type: 'creating' | 'success' | 'error' }) => { const getBadgeStyles = () => { switch (type) { case 'creating': return { bg: 'var(--warning-light)', color: 'var(--warning)', text: 'Creating Record' }; case 'success': return { bg: 'var(--success-light)', color: 'var(--success)', text: 'Success' }; case 'error': return { bg: 'var(--error-light)', color: 'var(--error)', text: 'Error' }; } }; const styles = getBadgeStyles(); return ( {styles.text} ); }; const InfoItem = ({ label, value }: { label: string, value: string }) => (
{label}
{value}
); return (
{status === 'creating' && (
Creating Laconic Registry record...
)} {status === 'success' && (
Successfully deployed!
)} {status === 'error' && (
Deployment Failed
)}
{status === 'success' && (
{appName && (

Successfully deployed {appName && {appName}}

{repoUrl && (

Repository: {repoUrl}

)}
)} {txHash && } {appRecordId && } {recordId && } {lrn && } {dns && ( domainSuffix ? : )}
)} {status === 'error' && (
{error || 'An unknown error occurred'}
{txHash && }
)}
); }