diff --git a/src/components/admin/SmsCityProfilesPanel.jsx b/src/components/admin/SmsCityProfilesPanel.jsx index 43d9671..d571a8d 100644 --- a/src/components/admin/SmsCityProfilesPanel.jsx +++ b/src/components/admin/SmsCityProfilesPanel.jsx @@ -147,9 +147,9 @@ export const SmsCityProfilesPanel = () => { // ── UI helpers ────────────────────────────────────────────────────────── const ModeBadge = ({ mode }) => { if (mode === "notification") { - return Уведомление; + return Уведомление; } - return Ссылка; + return Ссылка; }; const Toggle = ({ checked, onChange, label }) => ( @@ -157,15 +157,16 @@ export const SmsCityProfilesPanel = () => { - {label} + {label && {label}} ); - const modeLabel = (mode) => mode === "notification" ? "Уведомление без ссылки" : "Согласование по ссылке"; + const inputCls = "w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-strong)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]"; + const cardCls = "rounded-xl border border-[var(--color-border)] bg-[var(--color-surface-strong)] p-4 space-y-3"; return (
@@ -191,58 +192,58 @@ export const SmsCityProfilesPanel = () => { {showForm ? "Отмена" : "+ Профиль"}
- {message && {message}} + {message && {message}} {/* Add/Edit form */} {showForm && ( - +

{editingId ? "Редактировать профиль" : "Новый профиль города"}

- {/* City */} -
- - -
- - {/* SMS enabled master toggle */} -
- setFormSmsEnabled(!formSmsEnabled)} label="SMS включены для этого города" /> - {!formSmsEnabled && ( -

⚠ Все SMS в этот город отключены

- )} + {/* City + master toggle */} +
+
+ + +
+
+ setFormSmsEnabled(!formSmsEnabled)} label="SMS включены для города" /> + {!formSmsEnabled && ( +

⚠ Все SMS в этот город отключены

+ )} +
{/* Delivery */} -
+
📦 Доставка
{formDeliveryMode === "notification" && ( @@ -251,33 +252,33 @@ export const SmsCityProfilesPanel = () => { onChange={(e) => setFormDeliveryText(e.target.value)} placeholder="Ваш заказ готов. Доставим по графику." rows={2} - className="w-full rounded-xl border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)] resize-none" + className={`${inputCls} resize-none`} /> )}

- {formDeliveryMode === "link" ? "Клиент получит ссылку для выбора даты доставки" : "Клиент получит уведомление — без согласования, без 2-й SMS"} + {formDeliveryMode === "link" ? "Клиент получит ссылку для выбора даты доставки" : "Уведомление без ссылки, без 2-й SMS"}

{/* Pickup */} -
+
🏪 Самовывоз
{formPickupMode === "notification" && ( @@ -286,18 +287,18 @@ export const SmsCityProfilesPanel = () => { onChange={(e) => setFormPickupText(e.target.value)} placeholder="Ваш заказ готов. Заберите со склада." rows={2} - className="w-full rounded-xl border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)] resize-none" + className={`${inputCls} resize-none`} /> )}
{/* Toggles row */}
-
- setFormSecondSms(!formSecondSms)} label="2-я SMS (повторная отправка)" /> +
+ setFormSecondSms(!formSecondSms)} label="2-я SMS (повтор)" />
-
- setFormPaidStorage(!formPaidStorage)} label="SMS о платном хранении" /> +
+ setFormPaidStorage(!formPaidStorage)} label="SMS: платное хранение" />
@@ -309,7 +310,7 @@ export const SmsCityProfilesPanel = () => { value={formNote} onChange={(e) => setFormNote(e.target.value)} placeholder="Например: Ялта — доставка без согласования" - className="w-full rounded-xl border border-[var(--color-border)] bg-[var(--color-bg)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-muted)]" + className={inputCls} />
@@ -340,28 +341,29 @@ export const SmsCityProfilesPanel = () => { ) : (
{profiles.map((p) => ( -
- {/* Header */} +
+ {/* Header row */}
-
+
{p.city} - handleQuickToggle(p, "sms_enabled")} label="" /> - {!p.sms_enabled && ( - SMS отключены + {!p.sms_enabled ? ( + SMS OFF + ) : ( + SMS ON )}
{/* Config grid */} -
+
{/* Delivery */} -
-
- 📦 Доставка: +
+
+ 📦 Доставка
{p.delivery_text && ( -

"{p.delivery_text}"

+

"{p.delivery_text}"

)}
{/* Pickup */} -
-
- 🏪 Самовывоз: +
+
+ 🏪 Самовывоз
{p.pickup_text && ( -

"{p.pickup_text}"

+

"{p.pickup_text}"

)}
- {/* Toggles */} -
- + {/* Toggles row */} +
+ 2-я SMS: {p.second_sms_enabled ? "✅" : "❌"} - + Платное хранение: {p.paid_storage_enabled ? "✅" : "❌"}
{p.note && ( -

💬 {p.note}

+

💬 {p.note}

)}
))}