u
This commit is contained in:
28
src/components/article/ArticlePhoto.jsx
Normal file
28
src/components/article/ArticlePhoto.jsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import Box from '@mui/material/Box';
|
||||
|
||||
export default function ArticlePhoto({ imageUrl }) {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
width: 200,
|
||||
height: 200,
|
||||
maxWidth: '100%',
|
||||
borderRadius: 2,
|
||||
overflow: 'hidden',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
bgcolor: imageUrl ? 'transparent' : 'action.hover',
|
||||
}}
|
||||
>
|
||||
{imageUrl ? (
|
||||
<Box
|
||||
component="img"
|
||||
src={imageUrl}
|
||||
alt=""
|
||||
sx={{ width: '100%', height: '100%', objectFit: 'contain' }}
|
||||
/>
|
||||
) : null}
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user