import { useState } from 'react'; import { Rocket, Trash2, ChevronDown, ChevronRight, ExternalLink } from 'lucide-react'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; import { StatusDot } from '@/components/shared/status-dot'; const buildpackColor = { dockercompose: 'secondary', nixpacks: 'outline', dockerfile: 'outline', }; function statusColor(status) { if (!status) return 'gray'; const s = status.toLowerCase(); if (s.includes('running') || s.includes('healthy')) return 'green'; if (s.includes('stopped') || s.includes('exited')) return 'red'; if (s.includes('building') || s.includes('starting')) return 'yellow'; return 'gray'; } export function CoolifyAppCard({ app, onDeploy, onDelete }) { const [expanded, setExpanded] = useState(false); return (
{app.name} {app.build_pack}
{/* Port + domain */}
{app._host_port && :{app._host_port}} {app.git_branch && {app.git_branch}} {app.fqdn && ( e.stopPropagation()} > {app.fqdn.replace(/^https?:\/\//, '')} )}
{/* Actions */}
{/* Expandable env vars */} {expanded && app._envs && (
{app._envs.length === 0 && No env vars} {app._envs.map((env) => (
{env.key} = {env.value}
))}
)}
); }