mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-23 22:20:23 +09:00
Merge pull request #5025 from jiangying000/main
fix typo in app/components/chat.tsx
This commit is contained in:
commit
ec95292209
@ -245,11 +245,11 @@ function useSubmitHandler() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export type RenderPompt = Pick<Prompt, "title" | "content">;
|
export type RenderPrompt = Pick<Prompt, "title" | "content">;
|
||||||
|
|
||||||
export function PromptHints(props: {
|
export function PromptHints(props: {
|
||||||
prompts: RenderPompt[];
|
prompts: RenderPrompt[];
|
||||||
onPromptSelect: (prompt: RenderPompt) => void;
|
onPromptSelect: (prompt: RenderPrompt) => void;
|
||||||
}) {
|
}) {
|
||||||
const noPrompts = props.prompts.length === 0;
|
const noPrompts = props.prompts.length === 0;
|
||||||
const [selectIndex, setSelectIndex] = useState(0);
|
const [selectIndex, setSelectIndex] = useState(0);
|
||||||
@ -727,7 +727,7 @@ function _Chat() {
|
|||||||
|
|
||||||
// prompt hints
|
// prompt hints
|
||||||
const promptStore = usePromptStore();
|
const promptStore = usePromptStore();
|
||||||
const [promptHints, setPromptHints] = useState<RenderPompt[]>([]);
|
const [promptHints, setPromptHints] = useState<RenderPrompt[]>([]);
|
||||||
const onSearch = useDebouncedCallback(
|
const onSearch = useDebouncedCallback(
|
||||||
(text: string) => {
|
(text: string) => {
|
||||||
const matchedPrompts = promptStore.search(text);
|
const matchedPrompts = promptStore.search(text);
|
||||||
@ -812,7 +812,7 @@ function _Chat() {
|
|||||||
setAutoScroll(true);
|
setAutoScroll(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onPromptSelect = (prompt: RenderPompt) => {
|
const onPromptSelect = (prompt: RenderPrompt) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setPromptHints([]);
|
setPromptHints([]);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user