import { useMemo, useState } from "react" import { Check, Copy, Terminal } from "lucide-react" import { Button } from "@/components/ui/button" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { buildUploadCommand } from "@/lib/submission-utils" type UploadCommandPanelProps = { presignedUrl: string } export function UploadCommandPanel({ presignedUrl, }: UploadCommandPanelProps) { const [copied, setCopied] = useState<"url" | "command" | null>(null) const uploadCommand = useMemo( () => buildUploadCommand(presignedUrl), [presignedUrl] ) async function handleCopy(value: string, kind: "url" | "command") { await navigator.clipboard.writeText(value) setCopied(kind) window.setTimeout(() => { setCopied((current) => (current === kind ? null : current)) }, 1400) } return ( Upload Docker image tar

This pre-signed URL expires in 3 hours. Upload your image tar with the generated command below.

Pre-signed URL

            {presignedUrl}
          

Shell command

            {uploadCommand}
          
) }