You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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