diff --git a/src/components/UI/Switch.jsx b/src/components/UI/Switch.jsx new file mode 100644 index 0000000..1de7fed --- /dev/null +++ b/src/components/UI/Switch.jsx @@ -0,0 +1,38 @@ +import React from "react"; + +/** + * Accessible iOS-style toggle switch. + * @param {object} props + * @param {boolean} props.checked + * @param {function} props.onChange Called with the next boolean value. + * @param {string} [props.label] Visible text next to the switch. + * @param {string} [props.title] Hover tooltip. + * @param {string} [props.className] + */ +export const Switch = ({ checked = false, onChange, label, title, className = "" }) => { + const id = React.useId(); + return ( + + ); +}; diff --git a/src/components/orders/OrderFilters.jsx b/src/components/orders/OrderFilters.jsx index 359657a..bd5c893 100644 --- a/src/components/orders/OrderFilters.jsx +++ b/src/components/orders/OrderFilters.jsx @@ -3,6 +3,7 @@ import { Button } from "../UI/Button"; import { Input } from "../UI/Input"; import { Panel } from "../UI/Panel"; import { DatePicker } from "../UI/DatePicker"; +import { Switch } from "../UI/Switch"; const DropdownSelect = ({ value, options, onChange, placeholder }) => { const [isOpen, setIsOpen] = React.useState(false); @@ -129,8 +130,8 @@ export const OrderFilters = ({ filters, setFilters, statusOptions = [], cities = return (
- {/* Row 1: Status + City + DeliveryType + Search */} -
+ {/* Row 1: Status + City + DeliveryType + Search (search spans wider) */} +
- {/* Row 2: Date range */} -
+ {/* Row 2: Date range + SMS problems (width matches its text) + hide-completed toggle */} +
updateFilter("dateFrom", v)} @@ -252,6 +230,23 @@ export const OrderFilters = ({ filters, setFilters, statusOptions = [], cities = ✕ Сбросить )} + + updateFilter("smsStatus", v)} + placeholder="Проблемы SMS" + /> + + {typeof onToggleHideCompleted === "function" && ( + + )}