Commit 594a1130 authored by Robert Knight's avatar Robert Knight

Convert remaining annotator components to TypeScript

parent 83e5973d
import type { ComponentChildren } from 'preact';
export type BannersProps = { children: ComponentChildren };
/** /**
* Render banners at the top of a document in a stacked column. * Render banners at the top of a document in a stacked column.
*
* @param {object} props
* @param {import("preact").ComponentChildren} props.children
*/ */
export default function Banners({ children }) { export default function Banners({ children }: BannersProps) {
return <div className="flex flex-col">{children}</div>; return <div className="flex flex-col">{children}</div>;
} }
...@@ -6,9 +6,9 @@ import { ...@@ -6,9 +6,9 @@ import {
} from '@hypothesis/frontend-shared/lib/next'; } from '@hypothesis/frontend-shared/lib/next';
import classnames from 'classnames'; import classnames from 'classnames';
/** import type { ContentInfoConfig } from '../../types/annotator';
* @typedef {import('../../types/annotator').ContentInfoConfig} ContentInfoConfig
*/ export type ContentInfoBannerProps = { info: ContentInfoConfig };
/** /**
* A banner that displays information about the current document and the entity * A banner that displays information about the current document and the entity
...@@ -18,11 +18,8 @@ import classnames from 'classnames'; ...@@ -18,11 +18,8 @@ import classnames from 'classnames';
* - Logo * - Logo
* - Container title (only shown on screens at `2xl` breakpoint and wider) * - Container title (only shown on screens at `2xl` breakpoint and wider)
* - Item title with previous and next links * - Item title with previous and next links
*
* @param {object} props
* @param {ContentInfoConfig} props.info
*/ */
export default function ContentInfoBanner({ info }) { export default function ContentInfoBanner({ info }: ContentInfoBannerProps) {
// Format item title to show subtitle // Format item title to show subtitle
let itemTitle = info.item.title; let itemTitle = info.item.title;
if (info.item.subtitle) { if (info.item.subtitle) {
......
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