"use client";

import { useAuth } from "@/lib/auth";
import { useRouter } from "next/navigation";
import StrategyForm, { DEFAULT_FORM } from "@/components/StrategyForm";

export default function CreateStrategyPage() {
  useAuth();
  const router = useRouter();

  return (
    <div className="p-4 max-w-2xl mx-auto">
      <div className="mb-5">
        <h1 className="text-lg font-bold text-slate-800">新增策略</h1>
        <p className="text-slate-500 text-xs mt-0.5">配置策略参数，创建后立即开始运行</p>
      </div>
      <StrategyForm
        mode="create"
        initialData={DEFAULT_FORM}
        onSuccess={(id) => router.push(`/strategy-plaza/${id}`)}
      />
    </div>
  );
}
