@@ -86,7 +86,7 @@ const InfoBar: React.FC = ({ device }) => { marginRight: '80px', }} > - {recurrentPaymentsEnabled && daysLeft != null ? : null} + {recurrentPaymentsEnabled && daysLeft != null ? : null} { +export const SubscriptionDaysBadge = ({ days, isInfoBar = false }: SubscriptionDaysBadgeProps) => { const normalizedDays = Number.isFinite(days) ? Math.max(0, Math.trunc(days)) : 0 const isExpiring = normalizedDays <= 3 const currentPlanUid = useAppSelector((state) => state.user.payment_plan.plan.uid) const { data } = useSession() const { showMessage } = useShowDataStore() + const prefix = isInfoBar ? 'Подписка закончится' : 'Закончится' + const label = normalizedDays <= 1 ? normalizedDays === 0 - ? 'Закончится сегодня' - : 'Закончится завтра' - : `Закончится через ${normalizedDays} ${declineDays(normalizedDays)}` + ? `${prefix} сегодня` + : `${prefix} завтра` + : `${prefix} через ${normalizedDays} ${declineDays(normalizedDays)}` const handleRenew = async () => { if (!data?.access || !currentPlanUid) { @@ -70,7 +73,7 @@ export const SubscriptionDaysBadge = ({ days }: SubscriptionDaysBadgeProps) => { label ) : ( <> - Закончится через{' '} + {prefix} через{' '} {normalizedDays} {declineDays(normalizedDays)}