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.

DataCard.tsx 792B

12345678910111213141516171819202122232425262728
  1. import { Divider, Paper, Typography } from '@mui/material';
  2. interface IProps {
  3. data: {
  4. name: string;
  5. gender: string;
  6. age: number;
  7. };
  8. t: (x: string) => string;
  9. }
  10. const DataCard: React.FC<IProps> = ({ data, t }) => {
  11. return (
  12. <Paper sx={{ p: 3, height: '100%' }} elevation={3}>
  13. <Typography sx={{ fontWeight: 600 }}>{t('Name')}</Typography>
  14. <Typography display="inline"> {data.name}</Typography>
  15. <Divider />
  16. <Typography sx={{ fontWeight: 600 }}>{t('Age')}</Typography>
  17. <Typography display="inline"> {data.age}</Typography>
  18. <Divider />
  19. <Typography sx={{ fontWeight: 600 }}>{t('Gender')}</Typography>
  20. <Typography display="inline"> {data.gender}</Typography>
  21. <Divider />
  22. </Paper>
  23. );
  24. };
  25. export default DataCard;