import type { Metadata } from "next";
import { headers } from "next/headers";

export async function generateMetadata(): Promise<Metadata> {
  const headersList = await headers();
  const acceptLanguage = headersList.get("accept-language") || "";
  const lang = acceptLanguage.includes("zh") ? "zh" : "en";

  const titles = {
    en: "Video to Frames - Extract Frames from Videos",
    zh: "视频抽帧 - 从视频中提取帧",
  };

  const descriptions = {
    en: "Extract frames from videos with customizable frame rates. Perfect for sprite animations and game asset preparation. Supports MP4, MOV, AVI, WebM.",
    zh: "从视频中提取帧，可自定义帧率。非常适合精灵动画制作和游戏素材准备。支持 MP4、MOV、AVI、WebM。",
  };

  return {
    title: titles[lang],
    description: descriptions[lang],
    openGraph: {
      title: titles[lang],
      description: descriptions[lang],
    },
    twitter: {
      title: titles[lang],
      description: descriptions[lang],
    },
  };
}

export default function VideoFramesLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return children;
}
