Found the bug

This commit is contained in:
Carlos Mesquita
2024-08-24 00:54:55 +01:00
parent f0f38b335f
commit 2146ef1a92
6 changed files with 221 additions and 147 deletions

View File

@@ -7,7 +7,7 @@ interface Props {
setContextWordLine: React.Dispatch<React.SetStateAction<number | undefined>>
}
const TextComponent: React.FC<Props> = ({part, contextWord, setContextWordLine}) => {
const TextComponent: React.FC<Props> = ({ part, contextWord, setContextWordLine }) => {
const textRef = useRef<HTMLDivElement>(null);
const calculateLineNumbers = () => {
@@ -130,14 +130,11 @@ const TextComponent: React.FC<Props> = ({part, contextWord, setContextWordLine})
}*/
return (
<div className="flex flex-col gap-2 w-full">
<div className="border border-mti-gray-dim w-full rounded-full opacity-10" />
<div className="flex mt-2">
<div ref={textRef} className="h-fit ml-2 flex flex-col gap-4">
{part.context!.split('\n\n').map((line, index) => {
return <p key={`line-${index}`}><span className="mr-6">{index + 1}</span>{line}</p>
})}
</div>
<div className="flex mt-2">
<div ref={textRef} className="h-fit ml-2 flex flex-col gap-4">
{part.context!.split('\n\n').map((line, index) => {
return <p key={`line-${index}`}><span className="mr-6">{index + 1}</span>{line}</p>
})}
</div>
</div>
);