diff --git a/typescript/playground-common/src/shared/SettingsDialog.tsx b/typescript/playground-common/src/shared/SettingsDialog.tsx index 7eec05bb1..f2a952c97 100644 --- a/typescript/playground-common/src/shared/SettingsDialog.tsx +++ b/typescript/playground-common/src/shared/SettingsDialog.tsx @@ -112,12 +112,19 @@ const requiredButUnsetAtom = atom((get) => { ) }) +const requiredAndSetCountAtom = atom((get) => { + const envvars = get(envvarsAtom) + return get(runtimeRequiredEnvVarsAtom).filter((k) => + envvars.some(({ key, value }) => k === key && value && value.length > 0), + ).length +}) + type EnvVar = { key: string; value: string; type: 'baml' | 'tracing' | 'user' | 'config'; index: number | null } const EnvvarInput: React.FC<{ envvar: EnvVar }> = ({ envvar }) => { const [showEnvvarValues] = useAtom(showEnvvarValuesAtom) const setEnvKeyValue = useSetAtom(envKeyValuesAtom) return ( -