diff --git a/src/pages/AdminPanel.tsx b/src/pages/AdminPanel.tsx index 98fba07..df05ab8 100644 --- a/src/pages/AdminPanel.tsx +++ b/src/pages/AdminPanel.tsx @@ -1,77 +1,107 @@ import { Link } from 'react-router-dom' import { useTranslation } from 'react-i18next' -// Icons -const TicketIcon = () => ( - +// Icons - smaller versions for mobile +const TicketIcon = ({ className = "w-8 h-8" }: { className?: string }) => ( + ) -const CogIcon = () => ( - +const CogIcon = ({ className = "w-8 h-8" }: { className?: string }) => ( + ) -const PhoneIcon = () => ( - +const PhoneIcon = ({ className = "w-8 h-8" }: { className?: string }) => ( + ) -const WheelIcon = () => ( - +const WheelIcon = ({ className = "w-8 h-8" }: { className?: string }) => ( + ) -const TariffIcon = () => ( - +const TariffIcon = ({ className = "w-8 h-8" }: { className?: string }) => ( + ) -const ServerIcon = () => ( - +const ServerIcon = ({ className = "w-8 h-8" }: { className?: string }) => ( + ) -const AdminIcon = () => ( - +const AdminIcon = ({ className = "w-8 h-8" }: { className?: string }) => ( + ) -const ChartIcon = () => ( - +const ChartIcon = ({ className = "w-8 h-8" }: { className?: string }) => ( + ) -interface AdminCardProps { +const ChevronRightIcon = () => ( + + + +) + +interface AdminSection { to: string icon: React.ReactNode + mobileIcon: React.ReactNode title: string description: string color: string + bgColor: string + textColor: string } -function AdminCard({ to, icon, title, description, color }: AdminCardProps) { +// Mobile compact card +function MobileAdminCard({ to, mobileIcon, title, bgColor, textColor }: AdminSection) { return ( -
-
+
+
+ {mobileIcon} +
+
+ {title} + + ) +} + +// Desktop card +function DesktopAdminCard({ to, icon, title, description, bgColor, textColor }: AdminSection) { + return ( + +
+
{icon}
-

{title}

-

{description}

+
+

{title}

+

{description}

+
+ ) } @@ -79,75 +109,103 @@ function AdminCard({ to, icon, title, description, color }: AdminCardProps) { export default function AdminPanel() { const { t } = useTranslation() - const adminSections = [ + const adminSections: AdminSection[] = [ { to: '/admin/dashboard', icon: , + mobileIcon: , title: t('admin.nav.dashboard'), description: t('admin.panel.dashboardDesc'), - color: 'success' + color: 'success', + bgColor: 'bg-emerald-500/20', + textColor: 'text-emerald-400' }, { to: '/admin/tickets', icon: , + mobileIcon: , title: t('admin.nav.tickets'), description: t('admin.panel.ticketsDesc'), - color: 'warning' + color: 'warning', + bgColor: 'bg-amber-500/20', + textColor: 'text-amber-400' }, { to: '/admin/settings', icon: , + mobileIcon: , title: t('admin.nav.settings'), description: t('admin.panel.settingsDesc'), - color: 'accent' + color: 'accent', + bgColor: 'bg-blue-500/20', + textColor: 'text-blue-400' }, { to: '/admin/apps', icon: , + mobileIcon: , title: t('admin.nav.apps'), description: t('admin.panel.appsDesc'), - color: 'success' + color: 'success', + bgColor: 'bg-teal-500/20', + textColor: 'text-teal-400' }, { to: '/admin/wheel', icon: , + mobileIcon: , title: t('admin.nav.wheel'), description: t('admin.panel.wheelDesc'), - color: 'error' + color: 'error', + bgColor: 'bg-rose-500/20', + textColor: 'text-rose-400' }, { to: '/admin/tariffs', icon: , + mobileIcon: , title: t('admin.nav.tariffs'), description: t('admin.panel.tariffsDesc'), - color: 'info' + color: 'info', + bgColor: 'bg-cyan-500/20', + textColor: 'text-cyan-400' }, { to: '/admin/servers', icon: , + mobileIcon: , title: t('admin.nav.servers'), description: t('admin.panel.serversDesc'), - color: 'purple' + color: 'purple', + bgColor: 'bg-purple-500/20', + textColor: 'text-purple-400' }, ] return (
- {/* Header */} -
-
- + {/* Header - compact on mobile */} +
+
+
-

{t('admin.panel.title')}

-

{t('admin.panel.subtitle')}

+

{t('admin.panel.title')}

+

{t('admin.panel.subtitle')}

- {/* Grid of admin sections */} -
+ {/* Mobile: Compact 2-column grid */} +
{adminSections.map((section) => ( - + + ))} +
+ + {/* Tablet/Desktop: List style */} +
+ {adminSections.map((section) => ( + ))}