Notification type fallback

This commit is contained in:
Natsumi
2026-02-10 15:13:09 +13:00
parent 927e564a30
commit 2265def591
2 changed files with 8 additions and 4 deletions

View File

@@ -12,7 +12,7 @@ import { formatDateFilter } from '../../shared/utils';
import { i18n } from '../../plugin';
import { useUiStore, useUserStore } from '../../stores';
const { t } = i18n.global;
const { t, te } = i18n.global;
export const createColumns = ({ onDelete, onDeletePrompt }) => {
const { showUserDialog } = useUserStore();
@@ -66,9 +66,12 @@ export const createColumns = ({ onDelete, onDeletePrompt }) => {
header: () => t('table.moderation.type'),
cell: ({ row }) => {
const type = row.getValue('type');
const typeKey = `view.moderation.filters.${type}`;
const label = te(typeKey) ? t(typeKey) : type;
return (
<Badge variant="outline" class="text-muted-foreground">
{t(`view.moderation.filters.${type}`)}
{label}
</Badge>
);
}