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 { useNavigate } from 'react-router';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import type { TFunction } from 'i18next';
|
||||||
import { rbacApi, AuditLogEntry, AuditLogFilters } from '@/api/rbac';
|
import { rbacApi, AuditLogEntry, AuditLogFilters } from '@/api/rbac';
|
||||||
import { PermissionGate } from '@/components/auth/PermissionGate';
|
import { PermissionGate } from '@/components/auth/PermissionGate';
|
||||||
import { usePlatform } from '@/platform/hooks/usePlatform';
|
import { usePlatform } from '@/platform/hooks/usePlatform';
|
||||||
@@ -137,11 +138,7 @@ const INITIAL_FILTERS: FiltersState = {
|
|||||||
|
|
||||||
// === Utility functions ===
|
// === Utility functions ===
|
||||||
|
|
||||||
function translateAction(
|
function translateAction(action: string, t: TFunction): string {
|
||||||
action: string,
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
t: any,
|
|
||||||
): string {
|
|
||||||
return action
|
return action
|
||||||
.split(',')
|
.split(',')
|
||||||
.map((perm: string) => {
|
.map((perm: string) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user