matheusbezerra1's picture
ok, so this website should be a modern private real estate, its a website where we will add high end properties, invitation only, so you need to create all the structure, backend as well so we can add and edit properties, create accounts
61cba86 verified
Raw History Blame Contribute Delete
1.38 kB
import { Box, Image, Heading, Text, Flex, Button } from '@chakra-ui/react'
import { Link } from 'react-router-dom'
export default function PropertyCard({ property, showActions = false }) {
return (
<Box
borderWidth="1px"
borderRadius="lg"
overflow="hidden"
boxShadow="md"
_hover={{ boxShadow: 'xl' }}
transition="all 0.2s"
>
<Image src={property.mainImage} alt={property.title} h="200px" w="full" objectFit="cover" />
<Box p={6}>
<Heading as="h3" size="md" mb={2}>
{property.title}
</Heading>
<Text color="gray.600" mb={2}>
{property.location}
</Text>
<Text fontWeight="bold" mb={4}>
${property.price.toLocaleString()}
</Text>
<Flex justify="space-between" align="center">
<Link to={`/properties/${property.id}`}>
<Button colorScheme="blue" size="sm">
View Details
</Button>
</Link>
{showActions && (
<Flex>
<Link to={`/properties/${property.id}/edit`}>
<Button size="sm" mr={2}>
Edit
</Button>
</Link>
<Button size="sm" colorScheme="red">
Delete
</Button>
</Flex>
)}
</Flex>
</Box>
</Box>
)
}