import { ArrowLeft, type LucideIcon } from 'lucide-react'; import { useTranslation } from 'react-i18next'; import { Button } from '@/components/ui/button'; import { useIsMobile } from '@/hooks/useIsMobile'; import { useNavigate } from 'react-router-dom'; import type { ReactNode } from 'react'; interface SettingsPageLayoutProps { /** The icon component to display next to the title */ icon: LucideIcon; /** Translation key for the page title */ titleKey: string; /** Translation key for the page description */ descriptionKey: string; /** The main content of the settings page */ children: ReactNode; /** Optional className for the content container */ className?: string; } /** * Shared layout component for all settings pages. * Provides consistent header structure with mobile back button, icon, title, and description. */ export function SettingsPageLayout({ icon: Icon, titleKey, descriptionKey, children, className = 'space-y-6', }: SettingsPageLayoutProps) { const { t } = useTranslation(); const isMobile = useIsMobile(); const navigate = useNavigate(); return (
{isMobile && (

{t(titleKey)}

{t(descriptionKey)}

)} {!isMobile && (

{t(titleKey)}

{t(descriptionKey)}

)}
{children}
); }