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.2KB

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