mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-12 19:39:00 -05:00
87bcad2b20
Co-authored-by: Dhruwang <dhruwangjariwala18@gmail.com>
32 lines
730 B
TypeScript
32 lines
730 B
TypeScript
export type TAIEnablementBlockReason = "instanceNotConfigured";
|
|
|
|
interface TOrganizationAIEnablementState {
|
|
canEnableFeatures: boolean;
|
|
blockReason?: TAIEnablementBlockReason;
|
|
}
|
|
|
|
export const getDisplayedOrganizationAISettingValue = ({
|
|
currentValue,
|
|
isInstanceConfigured,
|
|
}: {
|
|
currentValue: boolean;
|
|
isInstanceConfigured: boolean;
|
|
}): boolean => isInstanceConfigured && currentValue;
|
|
|
|
export const getOrganizationAIEnablementState = ({
|
|
isInstanceConfigured,
|
|
}: {
|
|
isInstanceConfigured: boolean;
|
|
}): TOrganizationAIEnablementState => {
|
|
if (!isInstanceConfigured) {
|
|
return {
|
|
canEnableFeatures: false,
|
|
blockReason: "instanceNotConfigured",
|
|
};
|
|
}
|
|
|
|
return {
|
|
canEnableFeatures: true,
|
|
};
|
|
};
|