feat: Add i18n support, new content block types, course export, and lesson interaction tracking.

This commit is contained in:
2026-01-17 02:19:39 -03:00
parent b166387a48
commit 05faa20993
50 changed files with 3368 additions and 388 deletions
+37 -17
View File
@@ -2,9 +2,11 @@
import Link from 'next/link';
import { useAuth } from '@/context/AuthContext';
import { LayoutDashboard, Building2, Users2, LogOut, Webhook } from 'lucide-react';
import { useTranslation } from '@/context/I18nContext';
import { LayoutDashboard, ShieldCheck, LogOut, Webhook, Settings, Globe } from 'lucide-react';
export function Navbar() {
const { t, language, setLanguage } = useTranslation();
const { user, logout } = useAuth();
return (
@@ -23,31 +25,33 @@ export function Navbar() {
className="text-sm font-medium text-gray-400 hover:text-blue-400 transition-colors flex items-center gap-2"
>
<LayoutDashboard className="w-4 h-4" />
Courses
{t('nav.courses')}
</Link>
{user?.role === 'admin' && (
<>
<Link
href="/admin/organizations"
className="text-sm font-medium text-gray-400 hover:text-blue-400 transition-colors flex items-center gap-2"
>
<Building2 className="w-4 h-4" />
Organizations
</Link>
<Link
href="/admin/users"
className="text-sm font-medium text-gray-400 hover:text-blue-400 transition-colors flex items-center gap-2"
>
<Users2 className="w-4 h-4" />
Users
</Link>
{user.organization_id === '00000000-0000-0000-0000-000000000001' && (
<Link
href="/admin"
className="text-sm font-black text-indigo-400 hover:text-indigo-300 transition-colors flex items-center gap-2 bg-indigo-500/10 px-3 py-1.5 rounded-lg border border-indigo-500/20 shadow-glow-sm"
>
<ShieldCheck className="w-4 h-4" />
{t('nav.globalControl')}
</Link>
)}
<Link
href="/settings/webhooks"
className="text-sm font-medium text-gray-400 hover:text-blue-400 transition-colors flex items-center gap-2"
>
<Webhook className="w-4 h-4" />
Webhooks
{t('nav.webhooks')}
</Link>
<Link
href="/profile"
className="text-sm font-medium text-gray-400 hover:text-blue-400 transition-colors flex items-center gap-2"
>
<Settings className="w-4 h-4" />
{t('nav.profile')}
</Link>
</>
)}
@@ -65,6 +69,22 @@ export function Navbar() {
<div className="h-6 w-px bg-white/10 mx-2" />
{/* Language Switcher */}
<div className="flex items-center gap-2">
<Globe className="w-4 h-4 text-gray-500" />
<select
value={language}
onChange={(e) => setLanguage(e.target.value)}
className="bg-transparent text-[10px] font-black uppercase tracking-widest text-gray-400 hover:text-white transition-colors focus:outline-none cursor-pointer"
>
<option value="en" className="bg-gray-900">EN</option>
<option value="es" className="bg-gray-900">ES</option>
<option value="pt" className="bg-gray-900">PT</option>
</select>
</div>
<div className="h-6 w-px bg-white/10 mx-2" />
{user ? (
<div className="flex items-center gap-4">
<div className="flex flex-col items-end">