mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
chore(types): replace any with i18next TFunction in AdminAuditLog
translateAction took 't: any' with an eslint-disable on top — the only explicit 'any' annotation in the entire src/ tree. Inline TFunction from i18next; same call sites, full type safety on the i18n lookup. Now zero 'any' annotations in src/.
This commit is contained in:
@@ -2,6 +2,7 @@ import { useState, useCallback, useMemo } from 'react';
|
||||
import { useNavigate } from 'react-router';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import type { TFunction } from 'i18next';
|
||||
import { rbacApi, AuditLogEntry, AuditLogFilters } from '@/api/rbac';
|
||||
import { PermissionGate } from '@/components/auth/PermissionGate';
|
||||
import { usePlatform } from '@/platform/hooks/usePlatform';
|
||||
@@ -137,11 +138,7 @@ const INITIAL_FILTERS: FiltersState = {
|
||||
|
||||
// === Utility functions ===
|
||||
|
||||
function translateAction(
|
||||
action: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
t: any,
|
||||
): string {
|
||||
function translateAction(action: string, t: TFunction): string {
|
||||
return action
|
||||
.split(',')
|
||||
.map((perm: string) => {
|
||||
|
||||
Reference in New Issue
Block a user