upgrade react 19, remove preact usage

This commit is contained in:
2024-12-27 15:43:48 +08:00
parent 4b36debd0b
commit 48ead03629
14 changed files with 43 additions and 43 deletions

View File

@@ -1,7 +1,7 @@
import { createRef } from "preact";
import { createRef } from "react";
import { ChatStore } from "@/types/chatstore";
import { StateUpdater, useEffect, useState, Dispatch } from "preact/hooks";
import { useEffect, useState, Dispatch } from "react";
import { Button } from "@/components/ui/button";
import {
AudioWaveform,
@@ -14,7 +14,7 @@ import {
const WhisperButton = (props: {
chatStore: ChatStore;
inputMsg: string;
setInputMsg: Dispatch<StateUpdater<string>>;
setInputMsg: Dispatch<string>;
}) => {
const { chatStore, inputMsg, setInputMsg } = props;
const mediaRef = createRef();
@@ -25,7 +25,7 @@ const WhisperButton = (props: {
size="icon"
className={`m-1 p-1 ${isRecording !== "Mic" ? "animate-pulse" : ""}`}
disabled={isRecording === "Transcribing"}
ref={mediaRef}
ref={mediaRef as any}
onClick={async (event) => {
event.preventDefault(); // Prevent the default behavior