import { useState } from "react";
import { Layout } from "@/components/Layout";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { MilestoneVideos } from "@/routes/home/Milestone";
import type { Route } from "./+types/index";

export function meta({}: Route.MetaArgs) {
	return [{ title: "中V档案馆" }];
}

export default function Home() {
	const [input, setInput] = useState("");
	return (
		<Layout>
			<h2 className="text-2xl font-medium mt-8 mb-4">小工具</h2>
			<div className="flex max-sm:flex-col sm:items-center justify-between gap-7 mb-8">
				<div className="flex gap-3">
					<a href="/time-calculator">
						<Button>时间计算器</Button>
					</a>
					<a href="/labelling">
						<Button>歌曲打标</Button>
					</a>
				</div>

				<div className="flex sm:w-96 gap-3">
					<Input
						placeholder="输入 BV 号或 av 号"
						value={input}
						onChange={(e) => setInput(e.target.value)}
					/>
					<a href={`/song/${input}/add`}>
						<Button>收录视频</Button>
					</a>
					<a href={`/video/${input}/info`}>
						<Button>视频信息</Button>
					</a>
				</div>
			</div>

			<MilestoneVideos />
		</Layout>
	);
}
