feat: migrate orgconfig model across the app

This commit is contained in:
swve 2024-08-10 16:53:59 +02:00
parent 6485b6e1bb
commit 28a2456d69
12 changed files with 467 additions and 363 deletions

View file

@ -10,21 +10,9 @@ function useGetAIFeatures(props: UseGetAIFeatures) {
const [isEnabled, setisEnabled] = React.useState(false)
function checkAvailableAIFeaturesOnOrg(feature: string) {
const config = org?.config?.config?.AIConfig
const config = org?.config?.config?.features.ai.enabled
if (!config) {
return false
}
if (!config.enabled) {
return false
}
if (!config.features[feature]) {
return false
}
return true
return config
}
React.useEffect(() => {