Commit aacf19f7 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Convert AnnotationReplyToggle to TS

parent 145cf93d
import { LinkButton } from '@hypothesis/frontend-shared'; import { LinkButton } from '@hypothesis/frontend-shared';
/** export type AnnotationReplyToggleProps = {
* @typedef AnnotationReplyToggleProps onToggleReplies: () => void;
* @prop {() => void} onToggleReplies replyCount: number;
* @prop {number} replyCount threadIsCollapsed: boolean;
* @prop {boolean} threadIsCollapsed };
*/
/** /**
* Render a thread-card control to toggle (expand or collapse) all of this * Render a thread-card control to toggle (expand or collapse) all of this
* thread's children. * thread's children.
*
* @param {AnnotationReplyToggleProps} props
*/ */
function AnnotationReplyToggle({ function AnnotationReplyToggle({
onToggleReplies, onToggleReplies,
replyCount, replyCount,
threadIsCollapsed, threadIsCollapsed,
}) { }: AnnotationReplyToggleProps) {
const toggleAction = threadIsCollapsed ? 'Show replies' : 'Hide replies'; const toggleAction = threadIsCollapsed ? 'Show replies' : 'Hide replies';
const toggleText = `${toggleAction} (${replyCount})`; const toggleText = `${toggleAction} (${replyCount})`;
......
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