1
1
// ProblemSolverLeft.jsx
2
- import React , { useEffect } from 'react' ;
2
+ import React , { useEffect } from 'react' ;
3
3
import { useParams } from 'react-router-dom' ;
4
4
import {
5
5
Paper ,
@@ -31,13 +31,13 @@ const ProblemSolverLeft = () => {
31
31
// If the question is not found, display a message
32
32
return (
33
33
< Paper elevation = { 3 } sx = { { flex : 1 , display : 'flex' , flexDirection : 'column' , padding : 2 } } >
34
- < Typography variant = "h4" gutterBottom >
35
- Question not found
36
- { questionId }
37
- </ Typography >
38
- </ Paper >
39
- ) ;
40
- }
34
+ < Typography variant = "h4" gutterBottom >
35
+ Question not found
36
+ { questionId }
37
+ </ Typography >
38
+ </ Paper >
39
+ ) ;
40
+ }
41
41
42
42
return (
43
43
< Paper elevation = { 3 } sx = { { flex : 1 , display : 'flex' , flexDirection : 'column' , padding : 2 } } >
@@ -46,7 +46,9 @@ const ProblemSolverLeft = () => {
46
46
</ Typography >
47
47
< Divider sx = { { marginBottom : 2 , marginTop : 5 } } />
48
48
< Typography variant = "body1" sx = { { marginBottom : 2 , fontSize : '18px' } } >
49
- { question . description }
49
+ { question . description . split ( "\\n" ) . map ( ( s , key ) => {
50
+ return < p key = { key } > { s } </ p > ;
51
+ } ) }
50
52
</ Typography >
51
53
< Divider sx = { { marginBottom : 10 } } />
52
54
< Typography variant = "h6" gutterBottom sx = { { fontSize : '18px' } } >
@@ -61,7 +63,7 @@ const ProblemSolverLeft = () => {
61
63
< CardMedia
62
64
component = "img"
63
65
alt = { `Example ${ index + 1 } ` }
64
- sx = { { maxHeight : '100%' , width : 'auto' } }
66
+ sx = { { maxHeight : '100%' , width : 'auto' } }
65
67
height = "140"
66
68
image = { example . image }
67
69
/>
0 commit comments