mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 22:49:45 +01:00
feat: show current/total search results
This commit is contained in:
@@ -8,7 +8,7 @@ import { Editor } from "../../types";
|
|||||||
export type SearchReplacePopupProps = { editor: Editor };
|
export type SearchReplacePopupProps = { editor: Editor };
|
||||||
export function SearchReplacePopup(props: SearchReplacePopupProps) {
|
export function SearchReplacePopup(props: SearchReplacePopupProps) {
|
||||||
const { editor } = props;
|
const { editor } = props;
|
||||||
const { selectedText, results } = editor.storage
|
const { selectedText, results, selectedIndex } = editor.storage
|
||||||
.searchreplace as SearchStorage;
|
.searchreplace as SearchStorage;
|
||||||
|
|
||||||
const [isReplacing, setIsReplacing] = useState(false);
|
const [isReplacing, setIsReplacing] = useState(false);
|
||||||
@@ -160,8 +160,7 @@ export function SearchReplacePopup(props: SearchReplacePopupProps) {
|
|||||||
px: 1,
|
px: 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{results ? `${results.length}` : "0"}
|
{results ? `${selectedIndex + 1}/${results.length}` : ""}
|
||||||
{isExpanded ? "" : " results"}
|
|
||||||
</Text>
|
</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
Reference in New Issue
Block a user