mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 07:36:39 +08:00
chore: wip
This commit is contained in:
parent
43d38249d3
commit
5e514c5655
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user