'use client'; import { useState } from 'react'; import type { AppCardProps } from '@/types/component-props'; export default function AppCard({ app, showActions = true, onClick, onDelete, }: AppCardProps) { const [isDeleting, setIsDeleting] = useState(false); const handleDelete = async (e: React.MouseEvent) => { e.stopPropagation(); if (!confirm('Delete this app?')) return; setIsDeleting(true); onDelete?.(app.id ?? ''); }; const statusColors = { generating: 'bg-yellow-100 text-yellow-800', completed: 'bg-green-100 text-green-800', failed: 'bg-red-100 text-red-800', }; return (
onClick?.(app.id ?? '')} className="bg-white border rounded-lg p-4 hover:shadow-md transition-shadow cursor-pointer" >

{app.title}

{app.status}
{app.appType && ( {app.appType} )} {app.description && (

{app.description}

)} {app.createdAt && (

Created: {new Date(app.createdAt).toLocaleDateString()}

)}
{showActions && ( )}
); }