This pull request adds a new context and hook to provide a way to access global configuration options throughout the app. It also changes the environment variable name for speechEnabled from NEXT_PUBLIC_SPEECH_ENABLED to PUBLIC_SPEECH_ENABLED and updates all relevant files to use the new name.
src/app/layout.tsx: Added the GlobalConfigProvider as a parent component to the Providers component, with the config prop passed to it including speechEnabled set to the value of the environment variable PUBLIC_SPEECH_ENABLED.
src/features/chat/chat-ui/chat-input/chat-input.tsx: Updated chat-input.tsx to use the useGlobalConfigContext hook to assign the value of speechEnabled, replacing the use of the environment variable NEXT_PUBLIC_SPEECH_ENABLED. [1][2]
src/type.ts: Added a new environment variable PUBLIC_PUBLIC_SPEECH_ENABLED to src/type.ts.
Configuration improvements:
src/app/change-log/update.md: Changed the environment variable name NEXT_PUBLIC_SPEECH_ENABLED to PUBLIC_SPEECH_ENABLED in the update log for the Azure Chat Solution accelerator.
This pull request adds a new context and hook to provide a way to access global configuration options throughout the app. It also changes the environment variable name for
speechEnabled
fromNEXT_PUBLIC_SPEECH_ENABLED
toPUBLIC_SPEECH_ENABLED
and updates all relevant files to use the new name.Main interface changes:
src/features/global-config/global-client-config-context.tsx
: Added a new contextGlobalConfigContext
and a hookuseGlobalConfigContext
to provide a way to access global configuration options likespeechEnabled
throughout the app.src/app/layout.tsx
: Added theGlobalConfigProvider
as a parent component to theProviders
component, with theconfig
prop passed to it includingspeechEnabled
set to the value of the environment variablePUBLIC_SPEECH_ENABLED
.src/features/chat/chat-ui/chat-input/chat-input.tsx
: Updatedchat-input.tsx
to use theuseGlobalConfigContext
hook to assign the value ofspeechEnabled
, replacing the use of the environment variableNEXT_PUBLIC_SPEECH_ENABLED
. [1] [2]src/type.ts
: Added a new environment variablePUBLIC_PUBLIC_SPEECH_ENABLED
tosrc/type.ts
.Configuration improvements:
src/app/change-log/update.md
: Changed the environment variable nameNEXT_PUBLIC_SPEECH_ENABLED
toPUBLIC_SPEECH_ENABLED
in the update log for the Azure Chat Solution accelerator.docs/7-environment-variables.md
: Changed the environment variable nameNEXT_PUBLIC_SPEECH_ENABLED
toPUBLIC_SPEECH_ENABLED
.src/.env.example
: RenamedNEXT_PUBLIC_SPEECH_ENABLED
toPUBLIC_SPEECH_ENABLED
.docs/3-run-locally.md
: Changed the environment variable nameNEXT_PUBLIC_SPEECH_ENABLED
toPUBLIC_SPEECH_ENABLED
.