Commit 7838c8f2 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Convert `NotebookResultCount` to TS

parent 01a7747c
......@@ -3,14 +3,18 @@ import { Spinner } from '@hypothesis/frontend-shared/lib/next';
import { useRootThread } from './hooks/use-root-thread';
import { countVisible } from '../helpers/thread';
/**
* @typedef NotebookResultCountProps
* @prop {number} forcedVisibleCount
* @prop {boolean} isFiltered
* @prop {boolean} isLoading
* @prop {number} resultCount
*/
export type NotebookResultCountProps = {
/**
* Number of items that don't match applied filters but have been
* "forced visible" (expanded) by user interaction. These are described as
* "and <forcedVisibleCount> more" in filter descriptions
*/
forcedVisibleCount: number;
isFiltered: boolean;
isLoading: boolean;
resultCount: number;
};
/**
* Render count of annotations (or filtered results) visible in the notebook view
*
......@@ -27,7 +31,7 @@ function NotebookResultCount({
isFiltered,
isLoading,
resultCount,
}) {
}: NotebookResultCountProps) {
const rootThread = useRootThread();
const visibleCount = isLoading ? resultCount : countVisible(rootThread);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment