import DeleteModal from '@/components/inertia/delete-modal'; import Switch from '@/components/switch'; import { Button } from '@/components/ui/button'; import { Card } from '@/components/ui/card'; import Dashboard from '@/layouts/dashboard/layout'; import { SharedData } from '@/types/global'; import { Head, Link, router, usePage } from '@inertiajs/react'; import { Pencil, Trash2 } from 'lucide-react'; import { ReactNode } from 'react'; import AddLanguage from './partials/add-language'; const Index = () => { const { props } = usePage(); const { translate } = props; const { settings, common } = translate; const languageStatus = (lang: Language, checked: boolean) => { router.put( route('language.update', lang.id), { is_active: checked }, { preserveScroll: true, }, ); }; const defaultLanguage = (lang: Language) => { router.post(route('language.default', lang.id), { preserveScroll: true, }); }; return ( <>

{settings.language_settings}

Translation Scope Information
  • Translations will be applied to dashboard interfaces (admin, instructor, student).
  • Public pages are not affected by these translations as they are fully customizable through the page editor.
{props.langs.map((lang) => lang.is_default ? (
{lang.name} ({lang.nativeName})
{common.default}
) : (
{lang.name} ({lang.nativeName})
{lang.is_active ? ( ) : null} } /> languageStatus(lang, checked)} className="cursor-pointer" />
), )}
); }; Index.layout = (page: ReactNode) => ; export default Index;