Commit 4e42c0d9 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Convert FilterStatus to TypeScript

parent 3cf30772
...@@ -13,28 +13,36 @@ import { useSidebarStore } from '../store'; ...@@ -13,28 +13,36 @@ import { useSidebarStore } from '../store';
import { useRootThread } from './hooks/use-root-thread'; import { useRootThread } from './hooks/use-root-thread';
/** type FilterStatusMessageProps = {
* @typedef FilterStatusMessageProps /**
* @prop {number} [additionalCount=0] - * A count of items that are visible but do not match the filters (i.e. items
* A count of items that are visible but do not match the filters * that have been "forced visible" by the user)
* @prop {string} [entitySingular="annotation"] - */
* singular variant of the "thing" being shown (e.g. "result" when there is additionalCount?: number;
* a query string)
* @prop {string} [entityPlural="annotations"] /** Singular unit of the items being shown, e.g. "result" or "annotation" */
* @prop {string|null} [filterQuery] - Currently-applied filter query string, if any entitySingular?: string;
* @prop {string|null} [focusDisplayName] -
* Display name for the user currently being focused /** Plural unit of the items being shown */
* @prop {number} resultCount - entityPlural?: string;
* The number of "things" that match the current filter(s). When searching by
* query or focusing on a user, this value includes annotations and replies. /** Currently-applied filter query string, if any */
* When there are selected annotations, this number includes only top-level filterQuery?: string | null;
* annotations.
*/ /** Display name for the user currently focused, if any */
focusDisplayName?: string | null;
/**
* The number of items that match the current filter(s). When searching by
* query or focusing on a user, this value includes annotations and replies.
* When there are selected annotations, this number includes only top-level
* annotations.
*/
resultCount: number;
};
/** /**
* Render status text describing the currently-applied filters. * Render status text describing the currently-applied filters.
*
* @param {FilterStatusMessageProps} props
*/ */
function FilterStatusMessage({ function FilterStatusMessage({
additionalCount = 0, additionalCount = 0,
...@@ -43,7 +51,7 @@ function FilterStatusMessage({ ...@@ -43,7 +51,7 @@ function FilterStatusMessage({
filterQuery, filterQuery,
focusDisplayName, focusDisplayName,
resultCount, resultCount,
}) { }: FilterStatusMessageProps) {
return ( return (
<> <>
{resultCount > 0 && <span>Showing </span>} {resultCount > 0 && <span>Showing </span>}
......
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