import React, { useState } from 'react'; import { Button, Input, Label, Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, Tabs, TabsContent, TabsList, TabsTrigger, Badge, Alert, AlertDescription, AlertTitle, Checkbox, RadioGroup, RadioGroupItem, Switch, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Textarea, Progress, Separator, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Slider, Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogAction, AlertDialogCancel, Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PaginationEllipsis, Stepper, Step, TreeView, RichTextEditor, usePagination, useStepper, } from 'xertica-ui/ui'; import { Header, Sidebar } from 'xertica-ui/layout'; import { useLayout, useTheme } from 'xertica-ui/hooks'; import { toast } from 'sonner'; import { Link } from 'react-router-dom'; import { Trans, useTranslation } from 'react-i18next'; import { Settings, User, Mail, Phone, Calendar, Search, PanelLeft, Home, Users, Plus, Trash2, Archive, ArrowRightLeft, FileEdit, Clock, Map, } from 'lucide-react'; export function TemplateContent() { const { t } = useTranslation(); // ── TreeView demo data (built inside the component so labels react to language switches) ── const treeData = [ { id: 'components', label: t('templates.enhanced.treeView.nodes.components'), children: [ { id: 'ui', label: t('templates.enhanced.treeView.nodes.ui'), children: [ { id: 'button', label: t('templates.enhanced.treeView.nodes.button') }, { id: 'input', label: t('templates.enhanced.treeView.nodes.input') }, { id: 'pagination', label: t('templates.enhanced.treeView.nodes.pagination') }, ], }, { id: 'layout', label: t('templates.enhanced.treeView.nodes.layout'), children: [ { id: 'sidebar', label: t('templates.enhanced.treeView.nodes.sidebar') }, { id: 'header', label: t('templates.enhanced.treeView.nodes.header') }, ], }, ], }, { id: 'hooks', label: t('templates.enhanced.treeView.nodes.hooks'), // Hook identifiers stay as code — not translated. children: [ { id: 'use-pagination', label: 'usePagination' }, { id: 'use-stepper', label: 'useStepper' }, { id: 'use-tree-view', label: 'useTreeView' }, ], }, ]; const { sidebarExpanded, sidebarWidth } = useLayout(); const { disableDarkMode } = useTheme(); const [progress, setProgress] = useState(45); const [sliderValue, setSliderValue] = useState([50]); const [switchEnabled, setSwitchEnabled] = useState(false); const [richText, setRichText] = useState(''); // Dialog demo inputs (controlled so they re-localise on language switch). // Seeded lazily from `t(...)` so the initial value reflects the current // language at first render; subsequent language switches don't overwrite // user edits. const [dialogName, setDialogName] = useState(() => t('templates.dialogs.nameDefaultValue')); const [dialogUsername, setDialogUsername] = useState(() => t('templates.dialogs.usernameDefaultValue') ); // ── Pagination demo ───────────────────────────────────────────────────────── const { currentPage, totalPages, items, next, prev, goTo, canGoPrev, canGoNext } = usePagination({ totalItems: 120, pageSize: 10, }); // ── Stepper demo ──────────────────────────────────────────────────────────── const { currentStep, next: stepNext, prev: stepPrev, isFirstStep, isLastStep, } = useStepper({ totalSteps: 3 }); const handleFormSubmit = (e: React.FormEvent) => { e.preventDefault(); toast.success(t('templates.formSubmitSuccess')); }; return (
} />

{t('templates.title')}

{t('templates.subtitle')}

{/* Alert Examples */}

{t('templates.sections.alerts')}

{t('templates.alerts.infoTitle')} {t('templates.alerts.infoDescription')} {t('templates.alerts.errorTitle')} {t('templates.alerts.errorDescription')} {t('templates.alerts.successTitle')} {t('templates.alerts.successDescription')} {t('templates.alerts.warningTitle')} {t('templates.alerts.warningDescription')}
{/* Cards & Tabs */}

{t('templates.sections.cardsAndTabs')}

{t('templates.tabs.overview')} {t('templates.tabs.forms')} {t('templates.tabs.data')} {t('templates.tabs.settings')} {/* Overview Tab */}
{t('stats.totalUsers')} {t('stats.last30Days')}
{t('templates.overview.totalUsersDemoValue')} +12%
{t('stats.totalRevenue')} {t('stats.currentMonth')}
{t('templates.overview.revenueDemoValue')} +8%
{t('stats.conversionRate')} {t('stats.currentWeek')}
{t('templates.overview.conversionRateDemoValue')} -2%
{t('templates.overview.progressTitle')} {t('templates.overview.progressDescription')}
{progress}%
{sliderValue[0]}%
{/* Forms Tab */} {t('templates.forms.registrationTitle')} {t('templates.forms.registrationDescription')}