import{j as p}from"./document_model_editor-B0b9iLkL.js";import"./sentry_react-cODD7zWc.js";import{u,t as f}from"./index-Zdob0kL_.js";import{a3 as y,aZ as I,e as D,l as F,aP as d,a_ as L,g as M}from"./reactor_browser-CqcNBhxi.js";import{y as P}from"./design_system_connect-CyoiT4fi.js";import"./graphql-AKTCpY7l.js";import"./drive_explorer-C9ZlHrfH.js";import"./react/jsx-runtime-DldvXD6N.js";import"./document_model-BhnxVUEi.js";import"./zod-9j67vCAu.js";import"./react-DQSxOgtG.js";import"./design_system-D3L2kJJ3.js";import"./tailwind_merge-Dr4f9Rms.js";import"./react-dom-D6zQJsh6.js";import"./sentry_browser-B4YoBIIG.js";import"./react-dom/client-BVPiT_FE.js";import"./document_drive-CacD9AxC.js";import"./config-CU-aFfVJ.js";import"./graphql_request-BJtmW2JS.js";import"./design_system_ui-cfMsqDx9.js";const _=()=>{const s=y(),a=s?.type==="deleteItem",o=a?s.id:void 0,{t:e}=u(),t=I(o),i=t?.name,n=t?.kind,r=D(),m=F(t?.parentFolder);async function l(){if(!r||!o)return;d();const c=n==="FOLDER"?"notifications.deleteFolderSuccess":"notifications.fileDeleteSuccess";await L(r,o),M(m),f(e(c),{type:"connect-deleted"})}return p.jsx(P,{open:a,onDelete:()=>l(),onCancel:()=>d(),header:e(`modals.deleteItem.${n?.toLowerCase()}.header`,{item:i}),body:e(`modals.deleteItem.${n?.toLowerCase()}.body`),cancelLabel:e("common.cancel"),deleteLabel:e("common.delete")})};export{_ as DeleteItemModal};
