import{jsxs as r,Fragment as f,jsx as e}from"react/jsx-runtime";import{D as b}from"./delete-modal-DdJyKUdO.js";import{S as m}from"./switch-r95oaeM6.js";import{a as x,B as a}from"./ui-components-B24mpb8o.js";import{D as g}from"./layout-CZk01yM3.js";import{usePage as N,Head as v,Link as d,router as l}from"@inertiajs/react";import{Pencil as c,Trash2 as y}from"lucide-react";import w from"./add-language-DuBhYDVJ.js";import"react";import"next-themes";import"sonner";import"@radix-ui/react-label";import"class-variance-authority";import"@radix-ui/react-checkbox";import"@radix-ui/react-avatar";import"@radix-ui/react-dropdown-menu";import"@radix-ui/react-scroll-area";import"@radix-ui/react-popover";import"@radix-ui/react-radio-group";import"@radix-ui/react-dialog";import"@radix-ui/react-slot";import"clsx";import"@radix-ui/react-separator";import"@radix-ui/react-tooltip";import"@radix-ui/react-tabs";import"@radix-ui/react-accordion";import"@radix-ui/react-progress";import"@radix-ui/react-select";import"cmdk";import"@radix-ui/react-switch";import"react-day-picker";import"@radix-ui/react-slider";import"embla-carousel-react";import"@radix-ui/react-toggle-group";import"vaul";import"tailwind-merge";import"./main-Cv60h411.js";import"./theme-colors-CLpwvDr4.js";import"./appearance-zLWEcDPI.js";import"./language-79bZLpyc.js";import"./notification-BBQVVMqD.js";import"date-fns";import"./app-logo-CAnM-q9p.js";import"./route-D0xh7FtZ.js";import"./use-lang-Cw_jKJYs.js";import"./combobox-gnkJUuRk.js";import"./input-error-BbsDx4-P.js";const S=()=>{const{props:i}=N(),{translate:n}=i,{settings:s,common:p}=n,u=(t,o)=>{l.put(route("language.update",t.id),{is_active:o},{preserveScroll:!0})},h=t=>{l.post(route("language.default",t.id),{preserveScroll:!0})};return r(f,{children:[e(v,{title:s.language_settings}),r(x,{className:"mx-auto w-full max-w-[1000px] space-y-6 p-6",children:[r("div",{className:"flex items-center justify-between border-b border-b-gray-200 pb-6",children:[e("p",{className:"text-lg font-bold text-gray-900",children:s.language_settings}),e(w,{})]}),r("div",{className:"rounded-md bg-blue-50 p-4 text-sm text-blue-700",children:[e("div",{className:"mb-2 font-medium",children:"Translation Scope Information"}),r("ul",{className:"list-disc space-y-1 pl-5",children:[e("li",{children:"Translations will be applied to dashboard interfaces (admin, instructor, student)."}),e("li",{children:"Public pages are not affected by these translations as they are fully customizable through the page editor."})]})]}),e("div",{className:"flex flex-col gap-5",children:i.langs.map(t=>t.is_default?r("div",{className:"mb-5 flex items-center justify-between rounded-md border border-gray-300 p-5",children:[r("h6",{className:"text-xl",children:[t.name," (",t.nativeName,")"]}),r("div",{className:"flex items-center",children:[e("span",{className:"mr-4 rounded-full bg-blue-50 px-2 py-0.5 text-sm font-medium",children:p.default}),e(d,{href:route("language.edit",t.code),children:e(a,{size:"icon",variant:"secondary",className:"mr-3 h-7 w-7 rounded-full text-blue-500",children:e(c,{className:"h-4 w-4"})})}),e(m,{disabled:!0,checked:!0,name:t.code})]})]},t.code):r("div",{className:"flex items-center justify-between rounded-md border border-gray-300 p-5",children:[r("h6",{className:"text-xl",children:[t.name," (",t.nativeName,")"]}),r("div",{className:"flex items-center gap-3",children:[t.is_active?e(a,{onClick:()=>h(t),size:"sm",variant:"secondary",className:"rounded-full",children:"Set Default"}):null,e(d,{href:route("language.edit",t.code),children:e(a,{size:"icon",variant:"secondary",className:"h-7 w-7 rounded-full text-blue-500",children:e(c,{className:"h-4 w-4"})})}),e(b,{routePath:route("language.destroy",t.id),actionComponent:e(a,{size:"icon",variant:"ghost",className:"bg-destructive/8 hover:bg-destructive/6 h-8 w-8 rounded-full p-0",children:e(y,{className:"text-destructive text-sm"})})}),e(m,{name:t.code,defaultChecked:t.is_active,onCheckedChange:o=>u(t,o),className:"cursor-pointer"})]})]},t.code))})]})]})};S.layout=i=>e(g,{children:i});export{S as default};
