forked from React-Group/interstellar_ai
hamburgre #26
1 changed files with 15 additions and 17 deletions
|
@ -17,12 +17,21 @@ const InputOutputBackend: React.FC = () => {
|
|||
}
|
||||
|
||||
/* Variables for System-prompt */
|
||||
const [preferredCurrency, setPreferredCurrency] = useState(localStorage.getItem("preferredCurrency") || "")
|
||||
const [preferredLanguage, setPreferredLanguage] = useState(localStorage.getItem("preferredLanguage") || "")
|
||||
const [timeFormat, setTimeFormat] = useState(localStorage.getItem("timeFormat") || "")
|
||||
const [preferredMeasurement, setPreferredMeasurement] = useState(localStorage.getItem("preferredMeasurement") || "")
|
||||
const [timeZone, setTimeZone] = useState(localStorage.getItem("timeZone") || "")
|
||||
const [dateFormat, setDateFormat] = useState(localStorage.getItem("dateFormat") || "")
|
||||
const [preferredCurrency, setPreferredCurrency] = useState<string | null>("")
|
||||
const [preferredLanguage, setPreferredLanguage] = useState<string | null>("")
|
||||
const [timeFormat, setTimeFormat] = useState<string | null>("")
|
||||
const [preferredMeasurement, setPreferredMeasurement] = useState<string | null>("")
|
||||
const [timeZone, setTimeZone] = useState<string | null>("")
|
||||
const [dateFormat, setDateFormat] = useState<string | null>("")
|
||||
|
||||
useEffect(() => {
|
||||
setPreferredCurrency(localStorage.getItem("preferredCurrency"))
|
||||
setPreferredLanguage(localStorage.getItem("preferredLanguage"))
|
||||
setTimeFormat(localStorage.getItem("timeFormat"))
|
||||
setPreferredMeasurement(localStorage.getItem("preferredMeasurement"))
|
||||
setTimeZone(localStorage.getItem("timeZone"))
|
||||
setDateFormat(localStorage.getItem("dateFormat"))
|
||||
})
|
||||
|
||||
const [copyClicked, setCopyClicked] = useState(false)
|
||||
const [accessToken, setAccessToken] = useState("")
|
||||
|
@ -41,7 +50,6 @@ const InputOutputBackend: React.FC = () => {
|
|||
const [inputMessage, setInputMessage] = useState<string>("")
|
||||
const [inputDisabled, setInputDisabled] = useState(false)
|
||||
const [isRecording, setIsRecording] = useState(false)
|
||||
const [audioURL, setAudioURL] = useState<string | null>(null)
|
||||
const mediaRecorderRef = useRef<MediaRecorder | null>(null)
|
||||
const audioChunks = useRef<Blob[]>([])
|
||||
|
||||
|
@ -189,16 +197,6 @@ const InputOutputBackend: React.FC = () => {
|
|||
mediaRecorder.start()
|
||||
setIsRecording(true)
|
||||
}
|
||||
|
||||
const ffmpegRef = useRef<FFmpeg | null>(null)
|
||||
const audioRef = useRef("")
|
||||
|
||||
const loadFFmpeg = async () => {
|
||||
if (!ffmpegRef.current) {
|
||||
ffmpegRef.current = new FFmpeg()
|
||||
await ffmpegRef.current.load()
|
||||
}
|
||||
}
|
||||
|
||||
const stopRecording = () => {
|
||||
mediaRecorderRef.current?.stop()
|
||||
|
|
Loading…
Reference in a new issue