mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-29 18:13:47 +00:00
fix: improve tariff delete button visibility
- Added visual styling for disabled delete button (when tariff has active subscriptions) - Added tooltip explaining why delete is disabled - Added i18n translations for cannotDeleteHasSubscriptions
This commit is contained in:
@@ -1215,6 +1215,7 @@
|
|||||||
"deactivate": "Deactivate",
|
"deactivate": "Deactivate",
|
||||||
"toggleTrial": "Toggle Trial",
|
"toggleTrial": "Toggle Trial",
|
||||||
"delete": "Delete",
|
"delete": "Delete",
|
||||||
|
"cannotDeleteHasSubscriptions": "Cannot delete: has active subscriptions",
|
||||||
"confirmDelete": "Delete tariff?",
|
"confirmDelete": "Delete tariff?",
|
||||||
"confirmDeleteText": "This action cannot be undone. The tariff will be permanently deleted.",
|
"confirmDeleteText": "This action cannot be undone. The tariff will be permanently deleted.",
|
||||||
"days": "days",
|
"days": "days",
|
||||||
|
|||||||
@@ -989,6 +989,7 @@
|
|||||||
"deactivate": "غیرفعالسازی",
|
"deactivate": "غیرفعالسازی",
|
||||||
"toggleTrial": "تغییر آزمایشی",
|
"toggleTrial": "تغییر آزمایشی",
|
||||||
"delete": "حذف",
|
"delete": "حذف",
|
||||||
|
"cannotDeleteHasSubscriptions": "حذف ممکن نیست: اشتراکهای فعال وجود دارد",
|
||||||
"confirmDelete": "تعرفه حذف شود؟",
|
"confirmDelete": "تعرفه حذف شود؟",
|
||||||
"confirmDeleteText": "این عمل قابل بازگشت نیست. تعرفه برای همیشه حذف میشود.",
|
"confirmDeleteText": "این عمل قابل بازگشت نیست. تعرفه برای همیشه حذف میشود.",
|
||||||
"days": "روز",
|
"days": "روز",
|
||||||
|
|||||||
@@ -1725,6 +1725,7 @@
|
|||||||
"deactivate": "Деактивировать",
|
"deactivate": "Деактивировать",
|
||||||
"toggleTrial": "Переключить триал",
|
"toggleTrial": "Переключить триал",
|
||||||
"delete": "Удалить",
|
"delete": "Удалить",
|
||||||
|
"cannotDeleteHasSubscriptions": "Нельзя удалить: есть активные подписки",
|
||||||
"confirmDelete": "Удалить тариф?",
|
"confirmDelete": "Удалить тариф?",
|
||||||
"confirmDeleteText": "Это действие нельзя отменить. Тариф будет удален навсегда.",
|
"confirmDeleteText": "Это действие нельзя отменить. Тариф будет удален навсегда.",
|
||||||
"days": "дней",
|
"days": "дней",
|
||||||
|
|||||||
@@ -1027,6 +1027,7 @@
|
|||||||
"deactivate": "停用",
|
"deactivate": "停用",
|
||||||
"toggleTrial": "切换试用",
|
"toggleTrial": "切换试用",
|
||||||
"delete": "删除",
|
"delete": "删除",
|
||||||
|
"cannotDeleteHasSubscriptions": "无法删除:有活跃订阅",
|
||||||
"confirmDelete": "删除套餐?",
|
"confirmDelete": "删除套餐?",
|
||||||
"confirmDeleteText": "此操作不可撤销。套餐将被永久删除。",
|
"confirmDeleteText": "此操作不可撤销。套餐将被永久删除。",
|
||||||
"days": "天",
|
"days": "天",
|
||||||
|
|||||||
@@ -205,8 +205,16 @@ export default function AdminTariffs() {
|
|||||||
{/* Delete */}
|
{/* Delete */}
|
||||||
<button
|
<button
|
||||||
onClick={() => setDeleteConfirm(tariff.id)}
|
onClick={() => setDeleteConfirm(tariff.id)}
|
||||||
className="rounded-lg bg-dark-700 p-2 text-dark-300 transition-colors hover:bg-error-500/20 hover:text-error-400"
|
className={`rounded-lg p-2 transition-colors ${
|
||||||
title={t('admin.tariffs.delete')}
|
tariff.subscriptions_count > 0
|
||||||
|
? 'cursor-not-allowed bg-dark-700/50 text-dark-500'
|
||||||
|
: 'bg-dark-700 text-dark-300 hover:bg-error-500/20 hover:text-error-400'
|
||||||
|
}`}
|
||||||
|
title={
|
||||||
|
tariff.subscriptions_count > 0
|
||||||
|
? t('admin.tariffs.cannotDeleteHasSubscriptions')
|
||||||
|
: t('admin.tariffs.delete')
|
||||||
|
}
|
||||||
disabled={tariff.subscriptions_count > 0}
|
disabled={tariff.subscriptions_count > 0}
|
||||||
>
|
>
|
||||||
<TrashIcon />
|
<TrashIcon />
|
||||||
|
|||||||
Reference in New Issue
Block a user