forked from React-Group/interstellar_ai
Merge branch 'main' into main
This commit is contained in:
commit
b8eccfbefe
13 changed files with 65 additions and 68 deletions
|
@ -2,14 +2,10 @@
|
|||
import React from 'react';
|
||||
import InputOutputBackend from '../backend/InputOutputHandler';
|
||||
|
||||
interface AIProps{
|
||||
selectedIndex:number
|
||||
}
|
||||
|
||||
const AI: React.FC<AIProps> = ({selectedIndex}) => {
|
||||
const AI: React.FC = () => {
|
||||
return (
|
||||
<div className="ai-container">
|
||||
<InputOutputBackend selectedIndex={selectedIndex}/>
|
||||
<InputOutputBackend />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -2,16 +2,13 @@ import React, { useState } from 'react';
|
|||
import { useChatHistory } from '../hooks/useChatHistory';
|
||||
|
||||
const History: React.FC = () => {
|
||||
const [chatHistory, setChatHistory, setSelectedIndex] = useChatHistory()
|
||||
const [chatHistory, setSelectedIndex] = useChatHistory()
|
||||
const [isEditing, setIsEditing] = useState(false);
|
||||
const [inputValue, setInputValue] = useState<string>('');
|
||||
|
||||
|
||||
const handleEditButtonClick = () => {
|
||||
setIsEditing(true);
|
||||
|
||||
/* Thank you Eslint for this masterpiece of a code snippet */
|
||||
setChatHistory(chatHistory)
|
||||
/* Wow i feel so secure now */
|
||||
};
|
||||
|
||||
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
|
@ -38,7 +35,10 @@ const History: React.FC = () => {
|
|||
{/* Populate with history items */}
|
||||
{chatHistory.chats.map((chats, index) => (
|
||||
<li key={index}>
|
||||
<a href="#" onClick={() => handleHistoryClick(index)}>
|
||||
<a href="#" onClick={() => handleHistoryClick(index)} style={{
|
||||
backgroundColor: chatHistory.selectedIndex == index ? "var(--input-button-color)" : "",
|
||||
borderRadius:"5px"
|
||||
}}>
|
||||
{chatHistory.chats[index].name}
|
||||
</a>
|
||||
</li>
|
||||
|
|
|
@ -45,7 +45,6 @@ export const sendToDatabase = async () => {
|
|||
if (useName && usePassword) {
|
||||
const result = await changeSettings(useName, usePassword, JSON.parse(exportSettings()))
|
||||
if (result == true) {
|
||||
alert('Data has been transferred')
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue