PageSourceSearch

https://baroque-loc-esa2hpj7.manus.space/assets/GlobalPricingTab-C3EaUSkP.js

js baroque-loc-esa2hpj7.manus.space collected 2026-10-03 05:00:49 UTC 6,839 bytes, 1 lines download raw bytes

1import{r as s,j as a}from"./vendor-react-kZtSSTxB.js";import{t as x,C as b,k as g,l as u,m as C,g as P,B as y,i as h}from"./index-CG7GaBtR.js";import{I as i}from"./input-D180-m8l.js";import{L as c}from"./label-BtI4VKuF.js";import{L as T}from"./loader-circle-BOxlUC0V.js";import{S as F}from"./save-C60RMDiK.js";import"./vendor-trpc-EYooLEAL.js";import"./vendor-radix-DYX45BOR.js";import"./usePersistFn-Ds_bJ4Q8.js";function A(){const{data:n,isLoading:j,refetch:G}=x.globalPricing.get.useQuery(),t=x.globalPricing.update.useMutation(),[r,l]=s.useState(""),[o,d]=s.useState(""),[m,p]=s.useState("");s.useEffect(()=>{n&&(l((n.cleaningPrice/100).toFixed(2)),d((n.lateDeparturePrice/100).toFixed(2)),p((n.touristTaxPerPersonPerNight/100).toFixed(2)))},[n]);const f=async()=>{try{const e=Math.round(parseFloat(r||"0")*100),v=Math.round(parseFloat(o||"0")*100),N=Math.round(parseFloat(m||"0")*100);await t.mutateAsync({cleaningPrice:e,lateDeparturePrice:v,touristTaxPerPersonPerNight:N}),await G(),h.success("Options sauvegardées",{description:"Les prix ont été mis à jour avec succès"})}catch{h.error("Erreur",{description:"Impossible de sauvegarder les options"})}};return j?a.jsx("div",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:53",className:"flex items-center justify-center p-8",children:a.jsx(T,{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:54",className:"h-8 w-8 animate-spin text-muted-foreground"})}):a.jsxs("div",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:60",className:"space-y-6",children:[a.jsxs("div",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:61",children:[a.jsx("h2",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:62",className:"text-2xl font-bold",children:"Options Tarifaires Globales"}),a.jsx("p",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:63",className:"text-muted-foreground",children:"Gérez les prix des services additionnels applicables à toutes les réservations"})]}),a.jsxs(b,{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:68",children:[a.jsxs(g,{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:69",children:[a.jsx(u,{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:70",children:"Services Additionnels"}),a.jsx(C,{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:71",children:"Ces prix s'appliquent à toutes les réservations, indépendamment de la période"})]}),a.jsxs(P,{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:75",className:"space-y-6",children:[a.jsxs("div",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:76",className:"grid gap-4 md:grid-cols-2",children:[a.jsxs("div",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:77",className:"space-y-2",children:[a.jsx(c,{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:78",htmlFor:"cleaningPrice",children:"Prix du Ménage (€)"}),a.jsx(i,{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:79",id:"cleaningPrice",type:"number",step:"0.01",min:"0",value:r,onChange:e=>l(e.target.value),placeholder:"0.00"}),a.jsx("p",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:88",className:"text-sm text-muted-foreground",children:"Frais de ménage unique par réservation"})]}),a.jsxs("div",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:93",className:"space-y-2",children:[a.jsx(c,{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:94",htmlFor:"lateDeparturePrice",children:"Prix du Départ Tardif (€)"}),a.jsx(i,{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:95",id:"lateDeparturePrice",type:"number",step:"0.01",min:"0",value:o,onChange:e=>d(e.target.value),placeholder:"0.00"}),a.jsx("p",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:104",className:"text-sm text-muted-foreground",children:"Supplément pour départ après l'heure standard"})]}),a.jsxs("div",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:109",className:"space-y-2",children:[a.jsx(c,{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:110",htmlFor:"touristTaxPerPersonPerNight",children:"Taxe de Séjour (€ / pers. / nuit)"}
1),a.jsx(i,{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:111",id:"touristTaxPerPersonPerNight",type:"number",step:"0.01",min:"0",value:m,onChange:e=>p(e.target.value),placeholder:"0.00"}),a.jsx("p",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:120",className:"text-sm text-muted-foreground",children:"Taxe calculée automatiquement : nombre de personnes × nombre de nuits"})]})]}),a.jsx("div",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:126",className:"flex justify-end",children:a.jsx(y,{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:127",onClick:f,disabled:t.isPending,children:t.isPending?a.jsxs(a.Fragment,{children:[a.jsx(T,{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:133",className:"mr-2 h-4 w-4 animate-spin"}),"Enregistrement..."]}):a.jsxs(a.Fragment,{children:[a.jsx(F,{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:138",className:"mr-2 h-4 w-4"}),"Enregistrer"]})})})]})]}),a.jsxs(b,{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:147",className:"border-amber-200 bg-amber-50",children:[a.jsx(g,{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:148",children:a.jsx(u,{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:149",className:"text-amber-900",children:"ℹ️ Information"})}),a.jsx(P,{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:151",className:"text-sm text-amber-800",children:a.jsxs("ul",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:152",className:"list-disc list-inside space-y-1",children:[a.jsxs("li",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:153",children:["Ces prix sont ",a.jsx("strong",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:153",children:"indépendants des grilles tarifaires"})]}),a.jsxs("li",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:154",children:["Ils s'appliquent à ",a.jsx("strong",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:154",children:"toutes les réservations"}),", quelle que soit la période"]}),a.jsxs("li",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:155",children:["Le ménage est un ",a.jsx("strong",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:155",children:"frais unique"})," par réservation"]}),a.jsxs("li",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:156",children:["Le départ tardif est ",a.jsx("strong",{"data-loc":"client/src/components/admin/GlobalPricingTab.tsx:156",children:"optionnel"})," et choisi par le client lors de la réservation"]})]})})]})]})}export{A as GlobalPricingTab};

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.