"use client";

import { ProcessingStatus } from "@/components/media/processing-status";

interface JobStateProps {
  status: "idle" | "running" | "done" | "error";
  label?: string;
  details?: string;
  progress?: number;
}

export function JobState({ status, label, details, progress = 0 }: JobStateProps) {
  if (status === "running") {
    return <ProcessingStatus state="processing" label={label} details={details} progress={progress} />;
  }

  if (status === "done") {
    return <ProcessingStatus state="success" label={label ?? "Done"} details={details} />;
  }

  if (status === "error") {
    return <ProcessingStatus state="error" label={label ?? "Failed"} details={details} />;
  }

  return <ProcessingStatus state="idle" label={label} details={details} />;
}
