import{u as f,at as E,ha as F,au as m,r as D,cz as c}from"./index-C6OVXshM.js";const P=()=>{const{fsId:u}=f(),{project:s,isLoading:l}=E(),{currentData:a,isFetching:n}=F({fsId:+u}),{data:t,isLoading:R}=m(),i=D.useMemo(()=>{var d;let o=!0,r=!1;const e=(d=s==null?void 0:s.projectTeam)==null?void 0:d.find(({user:S})=>S.username===(t==null?void 0:t.username));return!a||n?o=!1:(s==null?void 0:s.projectName)!==(a==null?void 0:a.projectName)?(o=!1,r=!1):(r=!0,o=(e==null?void 0:e.teamRole)===c.DATA_OWNER),{can:o,isOwnFs:r,isDataScientist:(e==null?void 0:e.teamRole)===c.DATA_SCIENTIST,isFeatureStoreRestricted:(e==null?void 0:e.teamRole)===c.FEATURE_STORE_RESTRICTED}},[t==null?void 0:t.username,a,s,n]);return{canEdit:i.can,isOwnFs:i.isOwnFs,isDataScientist:i.isDataScientist,isFeatureStoreRestricted:i.isFeatureStoreRestricted,isLoading:l||n||R}};export{P as u};
