mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-16 23:45:33 +01:00
29 lines
870 B
TypeScript
29 lines
870 B
TypeScript
|
|
import Settings from '../Google';
|
||
|
|
import Examples from '../Examples';
|
||
|
|
import { useSetOptions } from '~/hooks';
|
||
|
|
import { useRecoilValue } from 'recoil';
|
||
|
|
import store from '~/store';
|
||
|
|
|
||
|
|
export default function GoogleView({ conversation, models, isPreset = false }) {
|
||
|
|
const optionSettings = useRecoilValue(store.optionSettings);
|
||
|
|
const { setOption, setExample, addExample, removeExample } = useSetOptions(
|
||
|
|
isPreset ? conversation : null,
|
||
|
|
);
|
||
|
|
if (!conversation) {
|
||
|
|
return null;
|
||
|
|
}
|
||
|
|
|
||
|
|
const { examples } = conversation;
|
||
|
|
const { showExamples, isCodeChat } = optionSettings;
|
||
|
|
return showExamples && !isCodeChat ? (
|
||
|
|
<Examples
|
||
|
|
examples={examples ?? []}
|
||
|
|
setExample={setExample}
|
||
|
|
addExample={addExample}
|
||
|
|
removeExample={removeExample}
|
||
|
|
/>
|
||
|
|
) : (
|
||
|
|
<Settings conversation={conversation} setOption={setOption} models={models} />
|
||
|
|
);
|
||
|
|
}
|