MCPcopy Create free account
hub / github.com/pacexy/flow / Annotations

Function Annotations

apps/reader/src/components/Annotation.tsx:150–168  ·  view source on GitHub ↗
({ tab })

Source from the content-addressed store, hash-verified

148 tab: BookTab
149}
150export const Annotations: React.FC<AnnotationsProps> = ({ tab }) => {
151 const { book, section } = useSnapshot(tab)
152
153 return (
154 <>
155 <FindMatches tab={tab} />
156 {/* with `key`, react will mount/unmount it automatically */}
157 {book.annotations
158 // seems to fix annotation flash when executing `next()` and `display()`
159 .filter((a) => a.spine.index === section?.index)
160 .map((annotation) => (
161 <Annotation key={annotation.id} tab={tab} annotation={annotation} />
162 ))}
163 {book.definitions.map((definition) => (
164 <Definition key={definition} tab={tab} definition={definition} />
165 ))}
166 </>
167 )
168}

Callers

nothing calls this directly

Calls 2

mapMethod · 0.80
filterMethod · 0.80

Tested by

no test coverage detected