💄 style(locales): Remove unused subscription labels from multiple locale files
This commit is contained in:
parent
d28a10b6df
commit
fb0c510b93
@ -1,5 +1,5 @@
|
||||
// @ts-ignore
|
||||
|
||||
|
||||
// API 更新时间:
|
||||
// API 唯一标识:
|
||||
import * as announcement from './announcement';
|
||||
|
||||
@ -4,9 +4,7 @@ import { Display } from '@/components/display';
|
||||
import { Separator } from '@workspace/ui/components/separator';
|
||||
import { useTranslations } from 'next-intl';
|
||||
|
||||
export function SubscribeBilling({
|
||||
order,
|
||||
}: {
|
||||
interface SubscribeBillingProps {
|
||||
order?: Partial<
|
||||
API.OrderDetail & {
|
||||
unit_price: number;
|
||||
@ -14,7 +12,9 @@ export function SubscribeBilling({
|
||||
subscribe_discount: number;
|
||||
}
|
||||
>;
|
||||
}) {
|
||||
}
|
||||
|
||||
export function SubscribeBilling({ order }: Readonly<SubscribeBillingProps>) {
|
||||
const t = useTranslations('subscribe');
|
||||
|
||||
return (
|
||||
@ -47,14 +47,6 @@ export function SubscribeBilling({
|
||||
<Display type='currency' value={order?.coupon_discount} />
|
||||
</span>
|
||||
</li>
|
||||
{order?.subscribe_discount && (
|
||||
<li>
|
||||
<span className='text-muted-foreground'>{t('subscriptionDiscount')}</span>
|
||||
<span>
|
||||
<Display type='currency' value={order?.subscribe_discount} />
|
||||
</span>
|
||||
</li>
|
||||
)}
|
||||
<li>
|
||||
<span className='text-muted-foreground'>{t('billing.fee')}</span>
|
||||
<span>
|
||||
|
||||
@ -1,78 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { Display } from '@/components/display';
|
||||
import useGlobalStore from '@/config/use-global';
|
||||
import { Combobox } from '@workspace/ui/custom-components/combobox';
|
||||
import { formatDate } from '@workspace/ui/utils';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { useCallback, useEffect, useMemo } from 'react';
|
||||
|
||||
interface SubscribeSelectorProps {
|
||||
value?: number;
|
||||
data: API.SubscribeDiscountInfo[];
|
||||
onChange: (value: number) => void;
|
||||
}
|
||||
|
||||
const SubscribeSelector: React.FC<SubscribeSelectorProps> = ({ value, data, onChange }) => {
|
||||
const t = useTranslations('subscribe');
|
||||
const { common } = useGlobalStore();
|
||||
const singleModel = common.subscribe.single_model;
|
||||
|
||||
useEffect(() => {
|
||||
if (singleModel && data.length > 0 && data[0]) {
|
||||
onChange(data[0].id);
|
||||
}
|
||||
}, [data, singleModel, onChange, value]);
|
||||
|
||||
const handleChange = useCallback(
|
||||
(selectedValue: number) => {
|
||||
if (singleModel) {
|
||||
if (selectedValue) {
|
||||
onChange(selectedValue);
|
||||
}
|
||||
} else {
|
||||
onChange(selectedValue);
|
||||
}
|
||||
},
|
||||
[singleModel, onChange],
|
||||
);
|
||||
|
||||
const options = useMemo(() => {
|
||||
return data.map((item) => ({
|
||||
children: (
|
||||
<div className='flex w-full items-center justify-between px-2 py-1.5'>
|
||||
<div className='mr-2 flex flex-col overflow-hidden'>
|
||||
<span className='truncate text-sm font-medium'>{item.name}</span>
|
||||
<time
|
||||
className='text-muted-foreground truncate text-xs'
|
||||
title={formatDate(new Date(item.expire_time))}
|
||||
>
|
||||
{formatDate(new Date(item.expire_time), false)}
|
||||
</time>
|
||||
</div>
|
||||
<span className='text-muted-foreground flex-shrink-0 text-sm' title='Price'>
|
||||
<Display value={item.price} type='currency' />
|
||||
</span>
|
||||
</div>
|
||||
),
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
}, [data]);
|
||||
|
||||
if (!data.length) return null;
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className='font-semibold'>{t('subscriptionDiscount')}</div>
|
||||
<Combobox<number, false>
|
||||
placeholder={t('selectSubscription')}
|
||||
options={options}
|
||||
value={value}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default SubscribeSelector;
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "Obnovit cenu",
|
||||
"resetTraffic": "Obnovit provoz",
|
||||
"resetTrafficDescription": "Obnovit provoz pouze pro aktuální měsíc",
|
||||
"resetTrafficTitle": "Obnovit provoz",
|
||||
"selectSubscription": "Vyberte předplatné",
|
||||
"subscriptionDiscount": "Sleva na předplatné"
|
||||
"resetTrafficTitle": "Obnovit provoz"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "Preis zurücksetzen",
|
||||
"resetTraffic": "Datenverkehr zurücksetzen",
|
||||
"resetTrafficDescription": "Verkehr nur für den aktuellen Monat zurücksetzen",
|
||||
"resetTrafficTitle": "Datenverkehr zurücksetzen",
|
||||
"selectSubscription": "Abonnement auswählen",
|
||||
"subscriptionDiscount": "Abonnementrabatt"
|
||||
"resetTrafficTitle": "Datenverkehr zurücksetzen"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "Reset Price",
|
||||
"resetTraffic": "Reset Traffic",
|
||||
"resetTrafficDescription": "Reset traffic for the current month only",
|
||||
"resetTrafficTitle": "Reset Traffic",
|
||||
"selectSubscription": "Select Subscription",
|
||||
"subscriptionDiscount": "Subscription Discount"
|
||||
"resetTrafficTitle": "Reset Traffic"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "Restablecer Precio",
|
||||
"resetTraffic": "Restablecer Tráfico",
|
||||
"resetTrafficDescription": "Restablecer el tráfico solo para el mes actual",
|
||||
"resetTrafficTitle": "Restablecer Tráfico",
|
||||
"selectSubscription": "Seleccionar suscripción",
|
||||
"subscriptionDiscount": "Descuento de Suscripción"
|
||||
"resetTrafficTitle": "Restablecer Tráfico"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "Restablecer Precio",
|
||||
"resetTraffic": "Restablecer Tráfico",
|
||||
"resetTrafficDescription": "Restablecer el tráfico solo para el mes actual",
|
||||
"resetTrafficTitle": "Restablecer Tráfico",
|
||||
"selectSubscription": "Seleccionar Suscripción",
|
||||
"subscriptionDiscount": "Descuento por Suscripción"
|
||||
"resetTrafficTitle": "Restablecer Tráfico"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "بازنشانی قیمت",
|
||||
"resetTraffic": "بازنشانی ترافیک",
|
||||
"resetTrafficDescription": "بازنشانی ترافیک فقط برای ماه جاری",
|
||||
"resetTrafficTitle": "بازنشانی ترافیک",
|
||||
"selectSubscription": "انتخاب اشتراک",
|
||||
"subscriptionDiscount": "تخفیف اشتراک"
|
||||
"resetTrafficTitle": "بازنشانی ترافیک"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "Nollaa hinta",
|
||||
"resetTraffic": "Nollaa liikenne",
|
||||
"resetTrafficDescription": "Nollaa liikenne vain kuluvan kuukauden osalta",
|
||||
"resetTrafficTitle": "Nollaa liikenne",
|
||||
"selectSubscription": "Valitse tilaus",
|
||||
"subscriptionDiscount": "Tilauksen alennus"
|
||||
"resetTrafficTitle": "Nollaa liikenne"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "Réinitialiser le prix",
|
||||
"resetTraffic": "Réinitialiser le trafic",
|
||||
"resetTrafficDescription": "Réinitialiser le trafic pour le mois en cours uniquement",
|
||||
"resetTrafficTitle": "Réinitialiser le trafic",
|
||||
"selectSubscription": "Sélectionner l'abonnement",
|
||||
"subscriptionDiscount": "Remise sur l'abonnement"
|
||||
"resetTrafficTitle": "Réinitialiser le trafic"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "मूल्य रीसेट करें",
|
||||
"resetTraffic": "ट्रैफ़िक रीसेट करें",
|
||||
"resetTrafficDescription": "केवल वर्तमान माह के लिए ट्रैफिक रीसेट करें",
|
||||
"resetTrafficTitle": "ट्रैफ़िक रीसेट करें",
|
||||
"selectSubscription": "सदस्यता चुनें",
|
||||
"subscriptionDiscount": "सदस्यता छूट"
|
||||
"resetTrafficTitle": "ट्रैफ़िक रीसेट करें"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "Ár visszaállítása",
|
||||
"resetTraffic": "Forgalom visszaállítása",
|
||||
"resetTrafficDescription": "Forgalmi adatok visszaállítása csak az aktuális hónapra",
|
||||
"resetTrafficTitle": "Forgalom visszaállítása",
|
||||
"selectSubscription": "Előfizetés kiválasztása",
|
||||
"subscriptionDiscount": "Előfizetési kedvezmény"
|
||||
"resetTrafficTitle": "Forgalom visszaállítása"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "価格をリセット",
|
||||
"resetTraffic": "トラフィックをリセット",
|
||||
"resetTrafficDescription": "今月のみのトラフィックをリセットする",
|
||||
"resetTrafficTitle": "トラフィックをリセット",
|
||||
"selectSubscription": "サブスクリプションを選択",
|
||||
"subscriptionDiscount": "サブスクリプション割引"
|
||||
"resetTrafficTitle": "トラフィックをリセット"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "가격 재설정",
|
||||
"resetTraffic": "트래픽 재설정",
|
||||
"resetTrafficDescription": "현재 월에 대한 트래픽만 재설정",
|
||||
"resetTrafficTitle": "트래픽 재설정",
|
||||
"selectSubscription": "구독 선택",
|
||||
"subscriptionDiscount": "구독 할인"
|
||||
"resetTrafficTitle": "트래픽 재설정"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "Tilbakestill pris",
|
||||
"resetTraffic": "Tilbakestill trafikk",
|
||||
"resetTrafficDescription": "Tilbakestill trafikk kun for inneværende måned",
|
||||
"resetTrafficTitle": "Nullstill trafikk",
|
||||
"selectSubscription": "Velg abonnement",
|
||||
"subscriptionDiscount": "Abonnementsrabatt"
|
||||
"resetTrafficTitle": "Nullstill trafikk"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "Zresetuj cenę",
|
||||
"resetTraffic": "Zresetuj ruch",
|
||||
"resetTrafficDescription": "Zresetuj ruch tylko na bieżący miesiąc",
|
||||
"resetTrafficTitle": "Zresetuj Ruch",
|
||||
"selectSubscription": "Wybierz subskrypcję",
|
||||
"subscriptionDiscount": "Zniżka na subskrypcję"
|
||||
"resetTrafficTitle": "Zresetuj Ruch"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "Redefinir Preço",
|
||||
"resetTraffic": "Redefinir Tráfego",
|
||||
"resetTrafficDescription": "Redefinir o tráfego apenas para o mês atual",
|
||||
"resetTrafficTitle": "Redefinir Tráfego",
|
||||
"selectSubscription": "Selecionar Assinatura",
|
||||
"subscriptionDiscount": "Desconto na Assinatura"
|
||||
"resetTrafficTitle": "Redefinir Tráfego"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "Resetează Prețul",
|
||||
"resetTraffic": "Resetează Traficul",
|
||||
"resetTrafficDescription": "Resetează traficul doar pentru luna curentă",
|
||||
"resetTrafficTitle": "Resetează Traficul",
|
||||
"selectSubscription": "Selectați Abonamentul",
|
||||
"subscriptionDiscount": "Reducere la abonament"
|
||||
"resetTrafficTitle": "Resetează Traficul"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "Сбросить цену",
|
||||
"resetTraffic": "Сбросить трафик",
|
||||
"resetTrafficDescription": "Сбросить трафик только за текущий месяц",
|
||||
"resetTrafficTitle": "Сбросить трафик",
|
||||
"selectSubscription": "Выберите подписку",
|
||||
"subscriptionDiscount": "Скидка на подписку"
|
||||
"resetTrafficTitle": "Сбросить трафик"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "รีเซ็ตราคา",
|
||||
"resetTraffic": "รีเซ็ตการจราจร",
|
||||
"resetTrafficDescription": "รีเซ็ตการใช้งานข้อมูลสำหรับเดือนปัจจุบันเท่านั้น",
|
||||
"resetTrafficTitle": "รีเซ็ตการจราจร",
|
||||
"selectSubscription": "เลือกการสมัครสมาชิก",
|
||||
"subscriptionDiscount": "ส่วนลดการสมัครสมาชิก"
|
||||
"resetTrafficTitle": "รีเซ็ตการจราจร"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "Fiyatı Sıfırla",
|
||||
"resetTraffic": "Trafiği Sıfırla",
|
||||
"resetTrafficDescription": "Yalnızca mevcut ay için trafiği sıfırla",
|
||||
"resetTrafficTitle": "Trafiği Sıfırla",
|
||||
"selectSubscription": "Abonelik Seç",
|
||||
"subscriptionDiscount": "Abonelik İndirimi"
|
||||
"resetTrafficTitle": "Trafiği Sıfırla"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "Скинути ціну",
|
||||
"resetTraffic": "Скинути трафік",
|
||||
"resetTrafficDescription": "Скинути трафік лише для поточного місяця",
|
||||
"resetTrafficTitle": "Скинути трафік",
|
||||
"selectSubscription": "Виберіть підписку",
|
||||
"subscriptionDiscount": "Знижка на підписку"
|
||||
"resetTrafficTitle": "Скинути трафік"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "Đặt lại giá",
|
||||
"resetTraffic": "Đặt lại Lưu lượng",
|
||||
"resetTrafficDescription": "Đặt lại lưu lượng truy cập chỉ cho tháng hiện tại",
|
||||
"resetTrafficTitle": "Đặt lại Lưu lượng",
|
||||
"selectSubscription": "Chọn Gói Đăng Ký",
|
||||
"subscriptionDiscount": "Giảm giá Đăng ký"
|
||||
"resetTrafficTitle": "Đặt lại Lưu lượng"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "重置价格",
|
||||
"resetTraffic": "重置流量",
|
||||
"resetTrafficDescription": "仅重置本月的流量",
|
||||
"resetTrafficTitle": "重置流量",
|
||||
"selectSubscription": "选择订阅",
|
||||
"subscriptionDiscount": "订阅折扣"
|
||||
"resetTrafficTitle": "重置流量"
|
||||
}
|
||||
|
||||
@ -49,7 +49,5 @@
|
||||
"resetPrice": "重設價格",
|
||||
"resetTraffic": "重設流量",
|
||||
"resetTrafficDescription": "僅重設本月的流量",
|
||||
"resetTrafficTitle": "重設流量",
|
||||
"selectSubscription": "選擇訂閱",
|
||||
"subscriptionDiscount": "訂閱折扣"
|
||||
"resetTrafficTitle": "重設流量"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user