import { useParams } from "react-router-dom";

export default function VideoPage() {
  const { id } = useParams();
  const src = id ? `/uploads/videos/${id}.mp4` : "";

  return (
    <div className="min-h-svh flex items-center justify-center bg-black px-4 py-4">
      {id ? (
        <video
          src={src}
          controls
          playsInline
          preload="metadata"
          className="block w-full max-w-[960px] h-auto bg-black"
        />
      ) : (
        <p className="text-white/60 text-sm">视频不存在</p>
      )}
    </div>
  );
}
