import{r as n,j as e}from"./vendor-react-wBh_31cN.js";import{j as h}from"./vendor-redux-CJZrIb6x.js";import{P as g,g as x,r as c}from"./index-BKr2rJhV.js";import{u as j}from"./useProjectNavigate-5znX7Ojg.js";import{c as v}from"./vendor-router-D1GqFWiT.js";import{C as u}from"./checkbox-DbZXziG0.js";import{L as f}from"./label-Dnebucx5.js";const b=()=>{const l=h(),{id:a,fsId:t,fgId:o}=v(),[i,s]=n.useState(!1),r=j(),{handleDelete:d}=n.useContext(g);return{deleteFg:n.useCallback(async({force:p=!1,deleteFeatureViews:m=!1}={})=>{s(!0);try{await l.featureGroups.delete({projectId:+a,featureStoreId:+t,featureGroupId:+o,force:p,deleteFeatureViews:m}),d(x(c.project.featureGroup.overview,c.project.value,{id:a,fsId:t,fgId:o})),s(!1),r(c.project.featureGroup.list,{fsId:t})}catch{s(!1)}},[l,a,t,o,d,r]),isDeleting:i}};function S({force:l,onForceChange:a,deleteFeatureViews:t,onDeleteFeatureViewsChange:o}){const i=n.useId(),s=n.useId();return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(u,{id:i,className:"mt-0.5",checked:l,onCheckedChange:r=>a(r===!0)}),e.jsx(f,{htmlFor:i,className:"font-normal leading-snug cursor-pointer",children:"Force delete: delete this feature group even if feature views depend on it. Those feature views are left in place but will stop working."})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(u,{id:s,className:"mt-0.5",checked:t,onCheckedChange:r=>o(r===!0)}),e.jsx(f,{htmlFor:s,className:"font-normal leading-snug cursor-pointer",children:"Also delete the feature views that depend on this feature group, along with their training data."})]})]})}export{S as F,b as u};
