got rid of console.logs

This commit is contained in:
YasinOnm08 2024-10-01 09:22:33 +02:00
parent 8ee87b88e9
commit 171e8fd458
8 changed files with 14 additions and 44 deletions

View file

@ -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">

View file

@ -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}>

View file

@ -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]])
}