diff --git a/mechanic-pwa/frontend/src/pages/repairs/CarSelectPage.tsx b/mechanic-pwa/frontend/src/pages/repairs/CarSelectPage.tsx index 17b3e96..c369415 100644 --- a/mechanic-pwa/frontend/src/pages/repairs/CarSelectPage.tsx +++ b/mechanic-pwa/frontend/src/pages/repairs/CarSelectPage.tsx @@ -18,6 +18,15 @@ export default function CarSelectPage() { const [cars, setCars] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); + const [extOpen, setExtOpen] = useState(false); + const [extPlate, setExtPlate] = useState(""); + const [extMake, setExtMake] = useState(""); + + const continueExternal = () => { + const plate = extPlate.trim(); + if (!plate) return; + navigate("/repairs/new-external", { state: { plate, make: extMake.trim() || null } }); + }; useEffect(() => { let cancelled = false; @@ -62,6 +71,13 @@ export default function CarSelectPage() {
+ {error && (
{error} @@ -96,6 +112,41 @@ export default function CarSelectPage() { )}
+ {extOpen && ( +
+
+ +

Машина с улицы

+
+
+
+ + setExtPlate(e.target.value)} + placeholder="Х999ХХ199" + className="mt-1" + onKeyDown={(e) => e.key === "Enter" && continueExternal()} + /> +
+
+ + setExtMake(e.target.value)} + placeholder="Toyota Camry" + className="mt-1" + /> +
+ +
+
+ )} ); }