import { useCallback, useState, memo } from 'react'; import { useNavigate } from 'react-router'; import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; import { useTranslation } from 'react-i18next'; import { infoPagesApi } from '../api/infoPages'; import { AdminBackButton } from '../components/admin'; import { Toggle } from '../components/admin/Toggle'; import { useHapticFeedback } from '../platform/hooks/useHaptic'; import { useDestructiveConfirm } from '../platform/hooks/useNativeDialog'; import { cn } from '../lib/utils'; import type { InfoPageListItem, InfoPageType } from '../api/infoPages'; type FilterTab = 'all' | 'page' | 'faq'; // Icons const PlusIcon = () => ( ); const RefreshIcon = () => ( ); const PencilIcon = () => ( ); const TrashIcon = () => ( ); const FileTextIcon = () => ( ); // --- Page Row --- const PageRow = memo(function PageRow({ page, locale, onEdit, onDelete, onToggleActive, }: { page: InfoPageListItem; locale: string; onEdit: () => void; onDelete: () => void; onToggleActive: () => void; }) { const { t } = useTranslation(); const resolvedTitle = page.title[locale] || page.title['ru'] || page.title['en'] || ''; return (
{resolvedTitle}
{t('admin.infoPages.noPages')}