1import{a as p}from"./rolldown-runtime.DS2seoW7.js";import{E as v,S as u,g as n,k as h}from"./react-vendor.D2780ePa.js";import{t as g}from"./ui-vendor.BTz6WPHv.js";import{g as b,h as i,p as j,s as f}from"./index.C8VrBg5s.js";import{t as N}from"./ErrorBadge.ChnIsVcT.js";var l=p(h(),1),y=()=>{const{getRequest:r}=b(),[a,t]=(0,l.useState)([]),[s,o]=(0,l.useState)(!0),[m,d]=(0,l.useState)(null);(0,l.useEffect)(()=>{x()},[]);const x=async()=>{try{const c=await r("sc_repairs");c.data.status==="ok"?t(c.data.repairs):d("Ðе ÑдалоÑÑ Ð·Ð°Ð³ÑÑзиÑÑ ÑпиÑок ÑемонÑов")}catch{d("ÐÑоизоÑла оÑибка пÑи загÑÑзке даннÑÑ
")}finally{o(!1)}};return{repairs:a,isLoading:s,error:m}},e=v(),k=()=>(0,e.jsxs)("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2",children:[(0,e.jsxs)(n,{className:"group block rounded-md border border-[var(--border-color)] bg-[var(--bg-color-secondary)] p-6 hover:border-[var(--primary-color)]",to:i.SERVICE_CENTER_CREATE,children:[(0,e.jsx)("div",{className:"mb-4 inline-flex h-12 w-12 items-center justify-center rounded-full bg-[var(--primary-color)]/20 group-hover:bg-[var(--primary-color)]/30",children:(0,e.jsx)("svg",{className:"h-6 w-6 text-orange-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M12 6v6m0 0v6m0-6h6m-6 0H6",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2})})}),(0,e.jsx)("h3",{className:"text-lg font-semibold text-[var(--text-color)]",children:"СоздаÑÑ Ð·Ð°ÑÐ²ÐºÑ Ð½Ð° ÑемонÑ"}),(0,e.jsx)("p",{className:"mt-2 text-[var(--text-color)]/80",children:"ÐÑÑавÑÑе заÑÐ²ÐºÑ Ð½Ð° ÑÐµÐ¼Ð¾Ð½Ñ Ð²Ð°Ñего ÑÑÑÑойÑÑва"})]}),(0,e.jsxs)(n,{className:"group block rounded-md border border-[var(--border-color)] bg-[var(--bg-color-secondary)] p-6 hover:border-[var(--primary-color)]",to:i.SERVICE_CENTER_STATUS,children:[(0,e.jsx)("div",{className:"mb-4 inline-flex h-12 w-12 items-center justify-center rounded-full bg-[var(--primary-color)]/20 group-hover:bg-[var(--primary-color)]/30",children:(0,e.jsx)("svg",{className:"h-6 w-6 text-orange-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2})})}),(0,e.jsx)("h3",{className:"text-lg font-semibold text-[var(--text-color)]",children:"ÐÑовеÑиÑÑ ÑÑаÑÑÑ ÑемонÑа"}),(0,e.jsx)("p",{className:"mt-2 text-[var(--text-color)]/80",children:"УзнайÑе ÑÑаÑÑÑ ÑемонÑа ваÑего ÑÑÑÑойÑÑва"})]})]}),w=r=>({new:"ÐÐ¾Ð²Ð°Ñ Ð·Ð°Ñвка",in_progress:"Ð ÑабоÑе",waiting_parts:"Ðжидание запÑаÑÑей",ready:"ÐоÑов к вÑдаÑе",completed:"ÐавеÑÑÑн",cancelled:"ÐÑменÑн"})[r]||r,_=(r,a)=>r?"bg-emerald-50 border-emerald-100 text-emerald-700 dark:bg-emerald-900/20 dark:border-emerald-800/30 dark:text-emerald-400":a?"bg-rose-50 border-rose-100 text-rose-700 dark:bg-rose-900/20 dark:border-rose-800/30 dark:text-rose-400":"bg-amber-50 border-amber-100 text-amber-700 dark:bg-amber-900/20 dark:border-amber-800/30 dark:text-amber-400",C=({repair:r})=>{const a=new Date(r.repair_regtime*1e3),t=r.repair_priority==="1",s=r.repair_status==="completed",o=r.repair_status==="cancelled";return(0,e.jsxs)(n,{className:"group relative block overflow-hidden rounded-md border border-[var(--border-color)] p-6 transition-all duration-300 hover:border-[var(--primary-color)]",to:`${i.SERVICE_CENTER_STATUS}?id=${r.repair_unique_id}`,children:[(0,e.jsx)("div",{className:"absolute inset-0 -translate-x-full bg-gradient-to-r from-transparent via-[var(--primary-color)]/5 to-transparent opacity-0 transition-all duration-700 group-hover:translate-x-full group-hover:opacity-100"}),(0,e.jsxs)("div",{className:"relative flex flex-col gap-5",children:[(0,e.jsxs)("div",{className:"flex flex-col justify-between gap-3 sm:flex-row sm:items-center",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)("span",{className:"text-lg font-semibold text-[var(--text-color)]",children:["Ð ÐµÐ¼Ð¾Ð½Ñ #",r.repair_unique_id]}),t&&(0,e.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-rose-500 px-2.5 py-0.5 text-xs font-semibold text-white",children:[(0,e.jsx)("svg",{className:"h-3 w-3",fill:"
1currentColor",viewBox:"0 0 20 20",children:(0,e.jsx)("path",{clipRule:"evenodd",d:"M11.3 1.046A1 1 0 0112 2v5h4a1 1 0 01.82 1.573l-7 10A1 1 0 018 18v-5H4a1 1 0 01-.82-1.573l7-10a1 1 0 011.12-.38z",fillRule:"evenodd"})}),"СÑоÑно"]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-[var(--text-color)]/80",children:[(0,e.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5})}),(0,e.jsx)("span",{children:a.toLocaleDateString("ru-RU",{day:"numeric",month:"long",year:"numeric"})}),(0,e.jsx)("span",{className:"text-[var(--text-color)]/10",children:"â¢"}),(0,e.jsx)("span",{children:a.toLocaleTimeString("ru-RU",{hour:"2-digit",minute:"2-digit"})})]})]}),(0,e.jsxs)("span",{className:`flex items-center gap-2 rounded-full border px-4 py-2 text-sm font-medium ${_(s,o)}`,children:[(0,e.jsx)("span",{className:`h-2 w-2 rounded-full ${s?"bg-emerald-500":o?"bg-rose-500":"bg-amber-500"}`}),w(r.repair_status)]})]}),(0,e.jsxs)("div",{className:"flex items-center justify-between border-t border-[var(--border-color)] pt-6",children:[(0,e.jsx)("span",{className:"text-sm text-[var(--text-color)] opacity-50",children:"ÐажмиÑе Ð´Ð»Ñ Ð¿Ð¾Ð´ÑобноÑÑей"}),(0,e.jsx)("svg",{className:"h-5 w-5 text-[var(--text-color)] opacity-50 transition-transform duration-300 group-hover:translate-x-1 group-hover:text-[var(--primary-color)]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M14 5l7 7m0 0l-7 7m7-7H3",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2})})]})]})]},r.repair_id)},E=()=>{const r=u();return(0,e.jsx)("div",{className:"overflow-hidden rounded-md border border-[var(--border-color)] bg-[var(--bg-color-secondary)]",children:(0,e.jsx)("div",{className:"p-6",children:(0,e.jsxs)("div",{className:"flex flex-col items-start justify-between gap-6 sm:flex-row sm:items-center",children:[(0,e.jsxs)("div",{className:"max-w-2xl",children:[(0,e.jsx)("h1",{className:"text-2xl font-bold text-[var(--text-color)]",children:"СеÑвиÑнÑй ÑенÑÑ"}),(0,e.jsx)("p",{className:"mt-3 text-base text-[var(--text-color)]/80",children:"ÐÑоÑеÑÑионалÑнÑй ÑÐµÐ¼Ð¾Ð½Ñ ÐºÐ¾Ð¼Ð¿ÑÑÑеÑов, ноÑÑбÑков, планÑеÑов и оÑгÑеÑ
ники"})]}),(0,e.jsx)(j,{containerClassNames:"w-full md:w-auto",onClick:()=>{r(`${i.SERVICE_CENTER}#prices`)},variant:"orange",children:"ÐзнакомиÑÑÑÑ Ñ Ñенами"})]})})})};function B(){const{repairs:r,isLoading:a,error:t}=y();return a?(0,e.jsx)(f,{}):(0,e.jsxs)(g.div,{animate:{opacity:1,y:0},className:"space-y-6",initial:{opacity:0,y:20},children:[(0,e.jsx)(E,{}),(0,e.jsx)(k,{}),(0,e.jsx)("div",{className:"overflow-hidden rounded-md border border-[var(--border-color)] bg-[var(--bg-color-secondary)]",children:(0,e.jsxs)("div",{className:"p-6",children:[(0,e.jsx)("h2",{className:"mb-4 text-lg font-semibold",children:"Ðои заÑвки на ÑемонÑ"}),t&&(0,e.jsx)(N,{error:t}),r.length===0?(0,e.jsx)("div",{className:"py-6 text-center",children:(0,e.jsx)("p",{className:"text-[var(--text-color)] opacity-75",children:"У Ð²Ð°Ñ Ð¿Ð¾ÐºÐ° Ð½ÐµÑ Ð·Ð°Ñвок на ÑемонÑ"})}):(0,e.jsx)("div",{className:"space-y-6",children:r.map(s=>(0,e.jsx)(C,{repair:s},s.repair_id))})]})})]})}export{B as CabinetServiceCenterPage};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.