"use client"; import { useDistricts } from "@/lib/analytics-api"; import type { RecommendClass, RecommendMixInput } from "@/types/analytics"; const CLASSES: RecommendClass[] = ["Comfort", "Comfort+", "Business", "Elite"]; const MONTHS_OPTIONS = [12, 18, 24]; interface Props { value: RecommendMixInput; onChange: (next: RecommendMixInput) => void; onSubmit: () => void; isPending: boolean; error: string | null; } export function RecommendForm({ value, onChange, onSubmit, isPending, error, }: Props) { const districts = useDistricts(); const districtOptions = (districts.data ?? []).filter( (d) => d.district_name !== "не определён", ); const valid = value.district_name.length >= 2; return (
); } const labelStyle: React.CSSProperties = { display: "block", fontSize: 12, color: "#5b6066", marginBottom: 4, textTransform: "uppercase", letterSpacing: 0.4, }; const inputStyle: React.CSSProperties = { padding: "8px 10px", border: "1px solid #d1d5db", borderRadius: 6, fontSize: 14, width: "100%", boxSizing: "border-box", }; const hintStyle: React.CSSProperties = { display: "block", fontSize: 11, color: "#73767e", marginTop: 4, }; const primaryBtn = (enabled: boolean): React.CSSProperties => ({ padding: "10px 18px", background: enabled ? "#1d4ed8" : "#9ca3af", color: "#fff", border: "none", borderRadius: 6, fontSize: 14, fontWeight: 600, cursor: enabled ? "pointer" : "not-allowed", marginTop: 4, });