Merge branch 'main' into main
This commit is contained in:
commit
570106c2f4
8 changed files with 14 additions and 44 deletions
|
@ -10,17 +10,12 @@ interface ConversationProps {
|
|||
onResendClick: () => void;
|
||||
onEditClick: () => void;
|
||||
onCopyClick: () => void;
|
||||
isClicked:boolean
|
||||
isClicked: boolean
|
||||
}
|
||||
|
||||
const ConversationFrontend = React.forwardRef<HTMLDivElement, ConversationProps>(
|
||||
({ messages, onResendClick, onEditClick, onCopyClick, isClicked}, ref: ForwardedRef<HTMLDivElement>) => {
|
||||
const endOfMessagesRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
console.log(isClicked);
|
||||
|
||||
},[isClicked])
|
||||
|
||||
return (
|
||||
<div className="output">
|
||||
|
|
|
@ -6,11 +6,11 @@ interface InputProps {
|
|||
onSendClick: (message: string, override: boolean) => void;
|
||||
onMicClick: () => void;
|
||||
inputDisabled: boolean;
|
||||
isRecording: boolean
|
||||
isRecording: boolean;
|
||||
}
|
||||
|
||||
const InputFrontend = React.forwardRef<HTMLDivElement, InputProps>(
|
||||
({ message, onSendClick, onMicClick, inputDisabled, isRecording }, ref: ForwardedRef<HTMLDivElement>) => {
|
||||
({ message, onSendClick, onMicClick, inputDisabled, isRecording}, ref: ForwardedRef<HTMLDivElement>) => {
|
||||
const [inputValue, setInputValue] = useState('');
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -31,6 +31,13 @@ const InputFrontend = React.forwardRef<HTMLDivElement, InputProps>(
|
|||
}
|
||||
};
|
||||
|
||||
const handleSendClick = () => {
|
||||
if (inputValue.trim() !== "") {
|
||||
onSendClick(inputValue, false); // Send message to parent component
|
||||
setInputValue(''); // Clear input after sending
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="input" id="inputForm" ref={ref}>
|
||||
<input
|
||||
|
@ -41,7 +48,7 @@ const InputFrontend = React.forwardRef<HTMLDivElement, InputProps>(
|
|||
onChange={handleInputChange}
|
||||
onKeyDown={handleKeyDown}
|
||||
/>
|
||||
<button type="button" onClick={() => onSendClick(inputValue, false)} disabled={inputDisabled ? true : false}>
|
||||
<button type="button" onClick={handleSendClick} disabled={inputDisabled ? true : false}>
|
||||
<img src="/img/send.svg" alt="send" />
|
||||
</button>
|
||||
<button className={`microphone-button ${isRecording ? "red" : "var(--input-button-color)"}`} type="button" onClick={onMicClick}>
|
||||
|
|
|
@ -162,8 +162,6 @@ const Models: React.FC = () => {
|
|||
setRadioSelection(localStorage.getItem('radioSelection'))
|
||||
const handleStorageChange = () => {
|
||||
setSelectedModel(localStorage.getItem('selectedModel') || '');
|
||||
console.log("Changed the selectedModel")
|
||||
console.log(selectedModel)
|
||||
};
|
||||
handleStorageChange();
|
||||
|
||||
|
@ -239,10 +237,6 @@ const Models: React.FC = () => {
|
|||
|
||||
const modelClicked = (model: string) => {
|
||||
const category = selectedModel as keyof typeof modelList;
|
||||
console.log(model)
|
||||
console.log(category)
|
||||
console.log(modelList[category][model as keyof typeof modelList[typeof category]]);
|
||||
console.log(modelList[category]['model_type' as keyof typeof modelList[typeof category]])
|
||||
localStorage.setItem("model", modelList[category][model as keyof typeof modelList[typeof category]])
|
||||
localStorage.setItem("type", modelList[category]['model_type' as keyof typeof modelList[typeof category]])
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue