import { formatDate, formatDateTime } from '@/app/lib/formatDate'; import { useTranslations } from 'next-intl'; interface User { fullName: string; company: string | null; email: string; active: boolean; phone: string; genderType: 'MALE' | 'FEMALE'; birthday: string | null; createdAt: string; subscriptionType: 'DEMO' | string; tariffs: null; tariffInfo: TariffInfo; permission: null; verifiedStatus: 'VERIFIED' | 'PENDING' | 'UNVERIFIED'; } interface TariffInfo { id: string; status: 'EXPIRED' | 'ACTIVE' | 'PENDING'; startTariff: string; endTariff: string; tariffId: number; tariffName: string; tokens: number; maxFileOnDisk: number; currentFileOnDisk: number; currentFileCounts: number; maxFileCounts: number; } export function UserInfoModalWindow({ userInfo, setWindowClose, setWindowChildren }: { userInfo: User, // Исправлено: ожидаем User, а не TariffInfo setWindowClose: any, setWindowChildren: any }) { const t = useTranslations('Global'); const formatBytes = (bytes: number) => { if (bytes === 0) return '0 Bytes'; const k = 1024; const sizes = ['Bytes', 'KB', 'MB', 'GB']; const i = Math.floor(Math.log(bytes) / Math.log(k)); return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]; }; const getStatusBadge = (status: string) => { const statusConfig = { 'ACTIVE': { class: 'status-active', text: 'Active' }, 'EXPIRED': { class: 'status-expired', text: 'Expired' }, 'PENDING': { class: 'status-pending', text: 'Pending' }, 'VERIFIED': { class: 'status-verified', text: 'Verified' }, 'UNVERIFIED': { class: 'status-unverified', text: 'Unverified' } }; const config = statusConfig[status as keyof typeof statusConfig]; return config ? {config.text} : status; }; const getGenderText = (gender: string) => { return gender === 'MALE' ? t('male') : t('female'); }; return (