import { Card, Typography } from '@mui/material'; import { Box } from '@mui/system'; import { Item, ItemComment } from '../../../../data/types'; interface ItemDataProps { item: Item; comments: ItemComment[]; } export default function ItemData({ item, comments }: ItemDataProps) { return ( Description: {item.description} Price: {Number(item.price).toFixed(2)} {item.currency} {comments && comments.map((comment) => ( Comment: {comment.body} Score: {comment.score} Regret: {comment.regret ? 'Yes' : 'No'} Created:{' '} {comment.createdAt && new Date(comment.createdAt).toLocaleString()} ))} ); }