PageSourceSearch

https://psytopeople-5df4c3ec8d8a.herokuapp.com/build/assets/Index-BaDUPqEB.js

js psytopeople-5df4c3ec8d8a.herokuapp.com collected 2026-10-03 14:51:52 UTC 2,306 bytes, 1 lines download raw bytes

1import{e as f,r,_ as y,S as v,j as i,h as m,i as k,I as x,F as _,B as u}from"./app-C1UQ6lHS.js";import{B as C}from"./Blocks-CeWFqQac.js";import{A as I}from"./AppNav-B8mKUzqR.js";import{E as F}from"./Empty-D3OMI2as.js";import S from"./DetailsPeriod-Cgsmi01s.js";import{F as A}from"./Table-CfZOP1Kk.js";import"./index-DHa_bH3j.js";import"./Tooltip-CFReJpJR.js";import"./InputError-p4Us07AT.js";import"./Checkbox-Di0kGMIr.js";import"./index-BLB4NNlZ.js";import"./useBubbleLock-JZQbFiWG.js";import"./Form-DgW_DN3Z.js";import"./Input-OnK0nsHs.js";import"./Input-fK7TMx3P.js";import"./Search-uu0YI5qt.js";import"./index.esm-DJWvtpB_.js";import"./index-CSAFN5p-.js";function M(b){const{availability:j}=b,{formatDate:l}=f(),[a,n]=r.useState(),[o,g]=r.useState(y(j,"periods",[])),d=r.useCallback(()=>{n(void 0)},[]),p=r.useCallback(e=>{v.post(route("pro.availability.store"),{data:JSON.stringify({periods:e})},{onFinish:()=>{g(e)}})},[]),c=r.useCallback(()=>{n({available:!0,slots:[{}]})},[]);return i.jsxs(i.Fragment,{children:[i.jsx(I,{title:"Disponibilità professionale"}),a!==void 0&&i.jsx(S,{period:a,onComplete:e=>{const t=a.id;p(t!==void 0?o.map(s=>s.id===t?e:s):[...o,{...e,id:o.length+1}]),d()},onCancel:()=>d()}),i.jsxs(C,{children:[o&&o.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(A,{rowKey:"id",pagination:!1,scroll:{x:!0},dataSource:o,columns:[{key:"available",dataIndex:"available",title:"",render:(e,t)=>t.available?i.jsx(m,{color:"success",children:"Disponibile"}):i.jsx(m,{color:"error",children:"Non disponibile"})},{key:"starts_at",dataIndex:"date",title:"Inizio",render:(e,t)=>l(t.starts_at)},{key:"ends_at",dataIndex:"date",title:"Fine",render:(e,t)=>l(t.ends_at)},{key:"slots",dataIndex:"slots",title:"Orari",render:(e,t)=>(t.slots||[]).map((s,h)=>i.jsx("div",{children:[s.from,s.to].join(" - ")},h))},{key:"$btn",render:(e,t)=>i.jsxs(k,{children:[i.jsx(x,{icon:"edit",onClick:()=>{n(t)}}),i.jsx(x,{icon:"trash",onClick:()=>{p(o.filter(s=>s.id!==t.id))}})]})}]}),i.jsx(_,{justify:"flex-end",children:i.jsx(u,{type:"submit",onClick:()=>c(),children:"Aggiungi un nuovo periodo"})})]}),o.length===0&&i.jsx(F,{text:"Nessun periodo inserito",children:i.jsx(u,{type:"submit",onClick:()=>c(),children:"Aggiungi un nuovo periodo di disponibilità o indisponibilità"})})]})]})}export{M as default};

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.