From d87c8d83ca9b486bf5d68decd2071ffdd5b2ad89 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Sun, 9 Jun 2024 08:56:30 +0800 Subject: [PATCH] add annotation --- packages/web/pages/highlights.tsx | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/packages/web/pages/highlights.tsx b/packages/web/pages/highlights.tsx index 3a4cbd551..cf62a1f0d 100644 --- a/packages/web/pages/highlights.tsx +++ b/packages/web/pages/highlights.tsx @@ -4,6 +4,7 @@ import ReactMarkdown from 'react-markdown' import remarkGfm from 'remark-gfm' import { LabelChip } from '../components/elements/LabelChip' import { Box, HStack, VStack } from '../components/elements/LayoutPrimitives' +import { HighlightViewNote } from '../components/patterns/HighlightNotes' import { EmptyHighlights } from '../components/templates/homeFeed/EmptyHighlights' import { LibraryFilterMenu } from '../components/templates/navMenu/LibraryMenu' import { useApplyLocalTheme } from '../lib/hooks/useApplyLocalTheme' @@ -88,10 +89,31 @@ export default function HighlightsPage(): JSX.Element { ) } -interface HighlightCardProps { +type HighlightCardProps = { highlight: Highlight } +type HighlightAnnotationProps = HighlightCardProps + +function HighlightAnnotation({ highlight }: HighlightAnnotationProps): JSX.Element { + const [noteMode, setNoteMode] = useState<'edit' | 'preview'>('preview') + const [annotation, setAnnotation] = useState(highlight.annotation) + + return ( + { + setAnnotation(highlight.annotation) + }} + /> + ) +} + function HighlightCard(props: HighlightCardProps): JSX.Element { return ( )} + {props.highlight.labels && (