Skip to content

AI short drama & micro-drama video generator — turns any idea into a complete short-form drama using multi-agent AI pipeline (screenwriter → storyboard → frames → video). Seedance 2 VIP, Kling 3.0 Pro, Veo 3.1, Sora 2.

3.6 KB
Raw Blame
"use client";

import { useState } from "react";
import { Download, Play, Pause, ExternalLink, CheckCircle } from "lucide-react";

export default function VideoResult({ videoUrl, jobId }) {
  const [isPlaying, setIsPlaying] = useState(false);

  const handleDownload = () => {
    const a = document.createElement("a");
    a.href = videoUrl;
    a.download = `microdrama-${jobId}.mp4`;
    a.click();
  };

  return (
    <div
      className="rounded-2xl overflow-hidden"
      style={{
        backgroundColor: "#12121a",
        border: "1px solid rgba(124, 58, 237, 0.3)",
        boxShadow: "0 0 40px rgba(124, 58, 237, 0.1)",
      }}
    >
      {/* Header */}
      <div
        className="px-5 py-4 flex items-center gap-3"
        style={{ borderBottom: "1px solid #1a1a26" }}
      >
        <div
          className="w-8 h-8 rounded-full flex items-center justify-center"
          style={{ backgroundColor: "rgba(124, 58, 237, 0.2)" }}
        >
          <CheckCircle size={16} style={{ color: "#a78bfa" }} />
        </div>
        <div>
          <h2 className="text-sm font-semibold" style={{ color: "#e2e8f0" }}>
            Your Video is Ready
          </h2>
          <p className="text-xs" style={{ color: "#6b7280" }}>
            Generated by MicroDrama AI
          </p>
        </div>
        <div className="ml-auto flex items-center gap-2">
          <a
            href={videoUrl}
            target="_blank"
            rel="noopener noreferrer"
            className="flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs transition-all"
            style={{
              backgroundColor: "#1a1a26",
              border: "1px solid #22223a",
              color: "#94a3b8",
            }}
            onMouseEnter={(e) => {
              e.currentTarget.style.borderColor = "#7c3aed";
              e.currentTarget.style.color = "#a78bfa";
            }}
            onMouseLeave={(e) => {
              e.currentTarget.style.borderColor = "#22223a";
              e.currentTarget.style.color = "#94a3b8";
            }}
          >
            <ExternalLink size={12} />
            Open
          </a>
          <button
            onClick={handleDownload}
            className="flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-all"
            style={{
              background: "linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%)",
              color: "white",
              border: "none",
              cursor: "pointer",
              boxShadow: "0 2px 8px rgba(124, 58, 237, 0.4)",
            }}
          >
            <Download size={12} />
            Download
          </button>
        </div>
      </div>

      {/* Video player */}
      <div
        className="relative"
        style={{ backgroundColor: "#0a0a0f", aspectRatio: "16/9" }}
      >
        <video
          src={videoUrl}
          controls
          autoPlay
          loop
          className="w-full h-full"
          style={{ display: "block" }}
          onPlay={() => setIsPlaying(true)}
          onPause={() => setIsPlaying(false)}
        />
      </div>

      {/* Footer */}
      <div
        className="px-5 py-3 flex items-center justify-between"
        style={{ borderTop: "1px solid #1a1a26" }}
      >
        <span className="text-xs" style={{ color: "#4b5563" }}>
          Job ID:{" "}
          <span style={{ fontFamily: "monospace", color: "#6b7280" }}>
            {jobId}
          </span>
        </span>
        <span className="text-xs" style={{ color: "#4b5563" }}>
          Powered by MuAPI &amp; Claude AI
        </span>
      </div>
    </div>
  );
}