wip: params

This commit is contained in:
Danny Avila 2024-09-04 22:07:28 -04:00
parent 2c6874013a
commit f8067e91d4
No known key found for this signature in database
GPG key ID: 2DD9CC89B9B50364
2 changed files with 24 additions and 13 deletions

View file

@ -1,4 +1,4 @@
import React from 'react'; import React, { useEffect } from 'react';
import { useForm, FormProvider } from 'react-hook-form'; import { useForm, FormProvider } from 'react-hook-form';
import { ComponentTypes } from 'librechat-data-provider'; import { ComponentTypes } from 'librechat-data-provider';
import type { DynamicSettingProps, SettingsConfiguration } from 'librechat-data-provider'; import type { DynamicSettingProps, SettingsConfiguration } from 'librechat-data-provider';
@ -166,6 +166,17 @@ export default function Parameters() {
}, {} as Record<string, any>), }, {} as Record<string, any>),
}); });
const {
formState: { isDirty },
} = methods;
useEffect(() => {
if (isDirty) {
console.log('The form has been edited');
// You can perform any action here when the form becomes dirty
}
}, [isDirty]);
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
const onSubmit = (data: Record<string, any>) => { const onSubmit = (data: Record<string, any>) => {
console.log('Form data:', data); console.log('Form data:', data);

View file

@ -76,18 +76,18 @@ export default function useSideNavLinks({
}); });
} }
// if ( if (
// isAgentsEndpoint(endpoint) || isAgentsEndpoint(endpoint) ||
// (endpoint === EModelEndpoint.bedrock && interfaceConfig.parameters === true && keyProvided) (endpoint === EModelEndpoint.bedrock && interfaceConfig.parameters === true && keyProvided)
// ) { ) {
// links.push({ links.push({
// title: 'com_sidepanel_parameters', title: 'com_sidepanel_parameters',
// label: '', label: '',
// icon: Settings2, icon: Settings2,
// id: 'parameters', id: 'parameters',
// Component: Parameters, Component: Parameters,
// }); });
// } }
if (hasAccessToPrompts) { if (hasAccessToPrompts) {
links.push({ links.push({