* doc

* feat: navbar size

* navbar ui
This commit is contained in:
Archer
2024-12-12 17:54:38 +08:00
committed by GitHub
parent ddddd998c8
commit e71708ee76
7 changed files with 69 additions and 50 deletions

View File

@@ -121,7 +121,16 @@ const VariableInput = ({
const variablesForm = useContextSelector(ChatItemContext, (v) => v.variablesForm);
const variableList = useContextSelector(ChatBoxContext, (v) => v.variableList);
const { handleSubmit: handleSubmitChat } = variablesForm;
const { getValues, setValue, handleSubmit: handleSubmitChat } = variablesForm;
useEffect(() => {
variableList.forEach((item) => {
const val = getValues(`variables.${item.key}`);
if (item.defaultValue !== undefined && (val === undefined || val === null || val === '')) {
setValue(`variables.${item.key}`, item.defaultValue);
}
});
}, [variableList]);
return (
<Box py={3}>