Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

OrderCard.jsx 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { Card, Divider, Typography } from '@mui/material';
  2. import { Box } from '@mui/system';
  3. import PropType from 'prop-types';
  4. const OrderCard = ({ data }) => {
  5. return (
  6. <Card
  7. height="100%"
  8. sx={{
  9. backgroundColor: '#f2f2f2',
  10. mb: 2,
  11. p: 2,
  12. mx: { xs: 0, sm: 1 },
  13. width: { xs: '100%', sm: '47%', md: '100%', lg: '100%' },
  14. }}
  15. >
  16. <Box
  17. sx={{
  18. display: 'flex',
  19. flexDirection: 'column',
  20. alignItems: { xs: 'center', md: 'flex-start' },
  21. }}
  22. >
  23. <Typography sx={{ fontWeight: 600 }}>
  24. Order placed on: {data.date}
  25. </Typography>
  26. <Divider />
  27. <Typography sx={{ mt: 1 }}>By: {data.name}</Typography>
  28. <Typography>Total: ${data.totalPrice.toFixed(2)}</Typography>
  29. </Box>
  30. </Card>
  31. );
  32. };
  33. OrderCard.propTypes = {
  34. data: PropType.shape({
  35. date: PropType.string,
  36. name: PropType.string,
  37. totalPrice: PropType.number,
  38. }),
  39. };
  40. export default OrderCard;