"use client"; import { DashboardLayout } from "@/components/dashboard/DashboardLayout"; import { Card, CardContent } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Rocket, RotateCcw, Eye, MoreVertical, Plus, GitBranch, } from "lucide-react"; import { useEffect, useState } from "react"; import { Application, Deployment } from "@/lib/types"; import { getDeployments } from "@/core/deployment"; import { getApplications } from "@/lib/dockship/application"; import { cn } from "@/lib/utils"; export default function DeploymentsPage() { const [applications, setApplications] = useState([]); const [deployments, setDeployments] = useState([]); useEffect(() => { const fetch = async () => { const apps = await getApplications(); setApplications(apps); setDeployments((await getDeployments(apps)).filter((d) => d !== null)); }; fetch(); }, []); return ( {/* Header */}
{deployments.length} deployments
{deployments.map((dep) => (
{ applications.find((app) => app.deployments.includes(dep.image) )?.name }
{/* {dep.version} */}
{/* {dep.time} */}
))}
{/* Mobile cards */}
{deployments.map((dep) => (
{dep.image}
{dep.status}
{/*
By
{dep.deployedBy}
*/}
))}
); }