From fd86dc15734f3b7126d88f0130897c597100e30a Mon Sep 17 00:00:00 2001 From: polwex Date: Thu, 15 May 2025 20:32:25 +0700 Subject: m --- src/zoom/FullText.tsx | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/zoom/FullText.tsx (limited to 'src/zoom/FullText.tsx') diff --git a/src/zoom/FullText.tsx b/src/zoom/FullText.tsx new file mode 100644 index 0000000..615fe66 --- /dev/null +++ b/src/zoom/FullText.tsx @@ -0,0 +1,62 @@ +import React from "react"; +import { motion, AnimatePresence } from "motion/react"; +import Paragraph from "./Paragraph"; +import { useZoom } from "./hooks/useZoom"; +import { containerVariants, buttonVariants } from "./animations"; +import { NLP } from "sortug-ai"; + +interface TextFocusMorphProps { + text: string; + doc: NLP.Spacy.SpacyRes; + stanza?: NLP.Stanza.StanzaRes | undefined; +} + +const FullText: React.FC = ({ text, doc, stanza }) => { + const { viewState, navigateBack, handleElementClick } = useZoom(); + const { level } = viewState; + + // Split text into paragraphs + const paragraphs = text + .split("\n\n") + .map((p) => p.trim()) + .filter(Boolean); + + return ( +
+ {level !== "text" && ( + + + ← Back + + + )} + + + {paragraphs.map((paragraph, idx) => ( + + ))} + +
+ ); +}; + +export default FullText; -- cgit v1.2.3