Skip to content

🎥 Make videos programmatically with React

1022 B
Raw Blame
import type {AnyRemotionOption} from './option';

let askAIEnabled = true;
let configuredAskAIEnabled: boolean | null = null;

const cliFlag = 'disable-ask-ai' as const;

export const askAIOption = {
	name: 'Disable or Enable the Ask AI option',
	addedIn: '4.0.407',
	cliFlag,
	description: () => (
		<>
			If the Cmd + I shortcut of the Ask AI modal conflicts with your Studio,
			you can disable it using this.
		</>
	),
	ssrName: null,
	docLink: 'https://www.remotion.dev/docs/options/disable-ask-ai',
	type: false as boolean,
	getValue: ({commandLine}) => {
		if (commandLine[cliFlag] !== undefined) {
			askAIEnabled = false;
			return {
				value: askAIEnabled,
				source: 'cli',
			};
		}

		return {
			value: askAIEnabled,
			source: 'config',
		};
	},
	setConfig(value) {
		askAIEnabled = value;
		configuredAskAIEnabled = value;
	},
	getConfigValue: () => configuredAskAIEnabled,
	reset: () => {
		askAIEnabled = true;
		configuredAskAIEnabled = null;
	},
	id: cliFlag,
} satisfies AnyRemotionOption<boolean>;