Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

OrderCard.tsx 1.3KB

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