chore: wip

This commit is contained in:
DDMeaqua 2024-10-12 19:47:01 +08:00
parent 43d38249d3
commit 5e514c5655

View File

@ -370,7 +370,6 @@ export function ChatAction(props: {
text: string; text: string;
icon: JSX.Element; icon: JSX.Element;
onClick: () => void; onClick: () => void;
recording?: boolean;
}) { }) {
const iconRef = useRef<HTMLDivElement>(null); const iconRef = useRef<HTMLDivElement>(null);
const textRef = useRef<HTMLDivElement>(null); const textRef = useRef<HTMLDivElement>(null);
@ -379,7 +378,7 @@ export function ChatAction(props: {
icon: 16, icon: 16,
}); });
function updateWidth(recording?: boolean) { function updateWidth() {
if (!iconRef.current || !textRef.current) return; if (!iconRef.current || !textRef.current) return;
const getWidth = (dom: HTMLDivElement) => dom.getBoundingClientRect().width; const getWidth = (dom: HTMLDivElement) => dom.getBoundingClientRect().width;
const textWidth = getWidth(textRef.current); const textWidth = getWidth(textRef.current);
@ -837,7 +836,6 @@ export function ChatActions(props: {
} }
text={isListening ? Locale.Chat.StopSpeak : Locale.Chat.StartSpeak} text={isListening ? Locale.Chat.StopSpeak : Locale.Chat.StartSpeak}
icon={isListening ? <VoiceOpenIcon /> : <VoiceCloseIcon />} icon={isListening ? <VoiceOpenIcon /> : <VoiceCloseIcon />}
recording={isListening}
/> />
)} )}
</div> </div>