import React from "react"; import { getInvitationReferenceLabel } from "./invitationReference"; import { Badge } from "../UI/Badge"; import { Button } from "../UI/Button"; import { Panel } from "../UI/Panel"; import { DeliveryStateNotice } from "./DeliveryStateNotice"; import { formatDeliverySlotLabel } from "./deliveryDateFormatting"; const ACTIVE_STATES = new Set(["awaiting_choice", "opened", "reminder_sent"]); const STATE_LABELS = { awaiting_choice: "Ожидает ответа клиента", opened: "Страница открыта", reminder_sent: "Напоминание отправлено", transferred_to_logistics: "Передан логисту", paid_storage: "Платное хранение", delivered: "Доставлен", agreed: "Доставка согласована", }; export const DeliveryChoiceFlow = ({ invitation = {}, selectedSlot = null, onConfirmChoice = () => {}, }) => { const state = invitation.state || "awaiting_choice"; const isActive = ACTIVE_STATES.has(state); const invitationReference = getInvitationReferenceLabel(invitation); const slotSummary = selectedSlot ? formatDeliverySlotLabel(selectedSlot) : ""; if (!isActive) { return (
Согласование доставки
{invitationReference}. Выберите удобную половину дня.