ProductTags.jsx 679 B

123456789101112131415161718192021222324
  1. import {Typography} from "@mui/material";
  2. export const ProductTags = ({title, subtitle}) => {
  3. return (
  4. <Typography
  5. variant='body2'
  6. color='#616161'
  7. fontWeight='300'
  8. marginBottom='10px'
  9. >
  10. {title}: {
  11. Array.isArray(subtitle) ?
  12. subtitle.map((item, index) =>
  13. <span
  14. key={index}
  15. >
  16. { item }
  17. { subtitle.length-1 !== index && ", " }
  18. </span>)
  19. : subtitle
  20. }
  21. </Typography>
  22. )
  23. }