import type { Dispatch, FormEvent, SetStateAction } from "react"; import { RefreshCw, X } from "lucide-react"; import type { SiteForm } from "./sitesPageModel"; type SiteFormModalProps = { editingId: string | null; form: SiteForm; setForm: Dispatch>; saving: boolean; advancedOpen: boolean; setAdvancedOpen: Dispatch>; onClose: () => void; onSubmit: (event: FormEvent) => void | Promise; onTypeChange: (type: string) => void; }; export function SiteFormModal({ editingId, form, setForm, saving, advancedOpen, setAdvancedOpen, onClose, onSubmit, onTypeChange, }: SiteFormModalProps) { return (
event.stopPropagation()} >

{editingId ? "编辑站点" : "添加站点"}

setForm((current) => ({ ...current, name: event.target.value })) } />
setForm((current) => ({ ...current, url: event.target.value })) } />

格式: https://www.example.com/

{form.enabled ? "启用" : "停用"}
{form.type === "mteam" && (
馒头站点配置指南
正式站地址: https://api.m-team.cc
测试站地址: https://test2.m-team.cc (开发测试环境)
认证方式:必须使用「API Access Token」,不要使用 Cookie
1. 登录馒头站 → 控制台 → 实验室 → 存取令牌
2. 点击「创建令牌」,复制生成的 Token
3. 将 Token 填入下方「令牌」输入框
)}
{[ { value: "cookie", label: "Cookie" }, { value: "api_key", label: "API Key" }, { value: "auth_header", label: "Auth Header" }, ].map((option) => ( ))}
{form.auth_type === "cookie" && (