Spaces:
Sleeping
Sleeping
File size: 1,415 Bytes
22c310d 0d37b12 22c310d 0d37b12 22c310d |
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 42 |
// a card item represent a news in newsSection
import { Button, Card } from "react-bootstrap";
export default function StoreItem({ storeName, address, imageSrc, storeHref = null, deleteable = false, delButtonCallback = null }) {
return (
<Card
as={storeHref ? 'a' : undefined}
href={storeHref ? storeHref : undefined}
style={{ height: "200px" }}
>
<Card.Img
variant="top"
src={imageSrc}
style={{ height: "200px", objectFit: 'cover', position: 'center', borderRadius: '10px' }} />
<Card.ImgOverlay
className="text-start"
style={{
backgroundImage: 'linear-gradient(rgba(20, 20, 20, 0.6), rgba(20, 20, 20, 0.5))',
// position: 'relative',
borderRadius: '10px'
}}
>
<Card.Title>{storeName}</Card.Title>
<Card.Text style={{fontWeight:'bold'}}>
{address}
</Card.Text>
{deleteable ? (
<div className="d-flex justify-content-end pb-3">
<Button size='sm' onClick={delButtonCallback} variant='danger'
style={{
position: 'absolute',
bottom: '20px', // Khoảng cách từ dưới lên
right: '20px' // Khoảng cách từ phải qua
}}>
Xóa
</Button>
</div>
) : (<></>)}
</Card.ImgOverlay>
</Card>
);
} |