Spaces:
Running
Running
File size: 1,055 Bytes
819bacd 47b5f0c 819bacd 47b5f0c 819bacd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
import { useTheme } from "@emotion/react";
import { Box } from "@mui/material";
import { useEffect } from "react";
import ChunkComponent from "../chunkComponent";
export default function PreviewChunks({ chunks, onSelectedChunk }) {
const theme = useTheme();
useEffect(() => {}, [chunks]);
return (
<>
<Box
display="flex"
flexDirection="column"
flexGrow={1}
padding={2}
mb={2}
style={{
border: "2px solid black",
overflow: "hidden",
overflowY: "scroll",
borderRadius: "8px",
border: "1px solid #ccc",
backgroundColor: theme.palette.background.default,
height: "60%",
}}
>
{chunks.map((chunk, index) => (
<ChunkComponent
key={index}
documentName={`Chunk ${chunk.chunkId}`}
documentId={chunk.documentId}
documentNumber={index}
onSelectedChunk={onSelectedChunk}
></ChunkComponent>
))}
</Box>
</>
);
}
|