import{r as g,j as r,U as u}from"./app-BBZbvTSO.js";import{c as j}from"./utils-YhN_nlHn.js";import{D as C,a as S,b as N,c as A,d as D}from"./dialog-D_v2qgP5.js";import{S as T}from"./scroll-area-hNGxDuJk.js";import{f as L,G as b,D as k,S as F,L as y,A as v,T as m,F as E}from"./FieldFormModal-8xS4bc9K.js";import{C as O}from"./code-aABRHl_L.js";import{I as H}from"./image-BEhzBCM8.js";import{C as q}from"./clock-gA1FmRyJ.js";import{C as w}from"./calendar-DoGBS4zB.js";import{H as B}from"./hash-CTCupukW.js";import{L as G}from"./lock-C-nUbAQc.js";import{A as I}from"./at-sign-Czm704vp.js";import{L as M}from"./link-BHviGKHc.js";/* empty css            */import"./index-C0VDnRYN.js";import"./button-CZmOQP7j.js";import"./index-CbDI-tXU.js";import"./Combination-9YgcTppv.js";import"./index-13DH8-b5.js";import"./index-C1VwruLz.js";import"./index-BosTFUDi.js";import"./input-dmj4QjAp.js";import"./label-BPDCCRHl.js";import"./textarea-DorjplNc.js";import"./checkbox-B0_9jnY6.js";import"./index-BCYyBCUm.js";import"./index-AiAmtg3H.js";import"./check-yuW7wFtQ.js";import"./Select-BSWSW26d.js";import"./floating-ui.dom-DtF1XweH.js";import"./alert-dialog-Ct4MX6gw.js";import"./radio-group-Ba_2z_o7.js";import"./index-Dbn6AP0q.js";import"./index-IvSACaye.js";import"./input-error-Bz7f2c6i.js";function Nr({isOpen:l,onClose:i,collectionId:c,projectId:p,onFieldCreated:s,collections:n,collectionFields:d,can:x}){const[e,a]=g.useState(null),h=o=>{a(o)},f=()=>{a(null),i(),s==null||s()};return r.jsxs(r.Fragment,{children:[r.jsx(C,{open:l&&!e,onOpenChange:i,children:r.jsxs(S,{className:"sm:max-w-2xl",children:[r.jsxs(N,{children:[r.jsx(A,{children:"Add Field"}),r.jsx(D,{className:"sr-only",children:"Select a field type to add to your collection."})]}),r.jsx(T,{className:"h-[400px] pr-4",children:r.jsx("div",{className:"grid grid-cols-2 gap-4",children:Object.entries(L).map(([o,t])=>r.jsxs("button",{onClick:()=>h(o),className:"flex items-start space-x-3 rounded-lg border p-4 text-left transition-colors hover:bg-accent",children:[r.jsx("div",{className:j("rounded-md p-2",t.bg),children:u.createElement({TextCursor:m,TextAlignLeft:v,Link:M,AtSign:I,Lock:G,SortNumericUp:B,ListOrdered:y,CheckSquare:F,Tint:k,Calendar:w,CalendarCheck:q,PhotoVideo:H,ExchangeAlt:b,Code:O}[t.icon]||m,{className:"text-white"})}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium",children:t.label}),r.jsx("p",{className:"text-sm text-muted-foreground",children:t.desc})]})]},o))})})]})}),e&&r.jsx(E,{isOpen:!!e,onClose:f,fieldType:e,collectionId:c,projectId:p,collections:n,collectionFields:d,can:x})]})}export{Nr as default};
