mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 03:10:15 +01:00
feat: complete bing styles (view)
This commit is contained in:
parent
b8720eec3d
commit
b07b74ba54
4 changed files with 102 additions and 82 deletions
|
|
@ -1,16 +1,16 @@
|
|||
import React, { useState, useEffect } from 'react';
|
||||
import React, { useState, useEffect, forwardRef } from 'react';
|
||||
import { Tabs, TabsList, TabsTrigger } from '../ui/Tabs.tsx';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import { setConversation } from '~/store/convoSlice';
|
||||
|
||||
export default function BingStyles() {
|
||||
function BingStyles(props, ref) {
|
||||
const dispatch = useDispatch();
|
||||
const [value, setValue] = useState('fast');
|
||||
const { model } = useSelector((state) => state.submit);
|
||||
const { conversationId } = useSelector((state) => state.convo);
|
||||
const { messages } = useSelector((state) => state.messages);
|
||||
|
||||
const isBing = model === 'bingai' || model === 'sydney';
|
||||
|
||||
useEffect(() => {
|
||||
if (isBing && !conversationId) {
|
||||
dispatch(setConversation({ toneStyle: value }));
|
||||
|
|
@ -32,6 +32,7 @@ export default function BingStyles() {
|
|||
defaultValue={value}
|
||||
className={`shadow-md mb-1 bing-styles ${show ? 'show' : ''}`}
|
||||
onValueChange={changeHandler}
|
||||
ref={ref}
|
||||
>
|
||||
<TabsList className="bg-white/[.60] dark:bg-gray-700">
|
||||
<TabsTrigger
|
||||
|
|
@ -56,3 +57,5 @@ export default function BingStyles() {
|
|||
</Tabs>
|
||||
);
|
||||
}
|
||||
|
||||
export default forwardRef(BingStyles);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue