ProductTags.jsx 706 B

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