From 4dd29af2562b4d5fbdc7dc6b65e03c145406272a Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Tue, 14 May 2024 19:06:06 +0800 Subject: [PATCH] Refactor search.tsx to use preact/hooks --- src/search.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/search.tsx b/src/search.tsx index 1494c2b..1805db2 100644 --- a/src/search.tsx +++ b/src/search.tsx @@ -1,7 +1,6 @@ import { IDBPDatabase } from "idb"; import { ChatStore } from "./app"; -import { useState } from "react"; -import { StateUpdater, useRef } from "preact/hooks"; +import { StateUpdater, useRef, useState } from "preact/hooks"; interface ChatStoreSearchResult { key: IDBValidKey; @@ -151,7 +150,7 @@ export default function Search(props: {
{searchResult .slice(pageIndex * 10, (pageIndex + 1) * 10) - .map((result) => { + .map((result: ChatStoreSearchResult) => { return (