import React from "react"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Label } from "@/components/ui/label"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { ConfigComponentProps } from "../types"; import { RunnerFlavor } from "@/lib/jobsApi"; interface TargetCardProps extends ConfigComponentProps { authenticated: boolean; flavors: RunnerFlavor[]; loading: boolean; } const formatHourly = (unitCostUsd: number, unitLabel: string): string => { const hourly = unitLabel === "minute" ? unitCostUsd * 60 : unitCostUsd; return `$${hourly.toFixed(2)}/hr`; }; const formatFlavorLine = (f: RunnerFlavor): string => { const accel = f.accelerator ? f.accelerator : f.cpu; return `${f.pretty_name} · ${accel} · ${formatHourly(f.unit_cost_usd, f.unit_label)}`; }; const TargetCard: React.FC = ({ config, updateConfig, authenticated, flavors, loading, }) => { const target = config.target; const value = target.runner === "local" ? "local" : `hf:${target.flavor ?? ""}`; const handleChange = (v: string) => { if (v === "local") { updateConfig("target", { runner: "local" }); } else if (v.startsWith("hf:")) { const flavor = v.slice("hf:".length); updateConfig("target", { runner: "hf_cloud", flavor }); } }; return ( Compute target

Cost shown is per running hour. Final policy uploads to your HF account when training completes.

); }; export default TargetCard;