Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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