import{r as R}from"./vendor-react-wBh_31cN.js";import{J as S}from"./index-BKr2rJhV.js";import{u as E}from"./selectors-CMD4o3wq.js";import{u as F}from"./useCurrentProject-C6qZaZgv.js";import{P as c}from"./project-eQY1xQe-.js";import{c as p}from"./vendor-router-D1GqFWiT.js";const C=()=>{const{fsId:d}=p(),{project:e,isLoading:f}=F(),{currentData:i,isFetching:r}=E({fsId:+d}),{data:s,isLoading:u}=S(),a=R.useMemo(()=>{var m;let o=!0,n=!1;const t=(m=e==null?void 0:e.projectTeam)==null?void 0:m.find(({user:l})=>l.username===(s==null?void 0:s.username));return!i||r?o=!1:(e==null?void 0:e.projectName)!==(i==null?void 0:i.projectName)?(o=!1,n=!1):(n=!0,o=(t==null?void 0:t.teamRole)===c.DATA_OWNER),{can:o,isOwnFs:n,isDataScientist:(t==null?void 0:t.teamRole)===c.DATA_SCIENTIST,isFeatureStoreRestricted:(t==null?void 0:t.teamRole)===c.FEATURE_STORE_RESTRICTED}},[s==null?void 0:s.username,i,e,r]);return{canEdit:a.can,isOwnFs:a.isOwnFs,isDataScientist:a.isDataScientist,isFeatureStoreRestricted:a.isFeatureStoreRestricted,isLoading:f||r||u}};export{C as u};
