27 lines
1.0 KiB
TypeScript
27 lines
1.0 KiB
TypeScript
import { Card, CardActionArea, CardContent, Paper, Rating, Typography } from "@mui/material";
|
|
import RatingType from "../../components/Rating";
|
|
|
|
export default function RatingCard(ratingType: RatingType) {
|
|
|
|
const handleClick = () => {
|
|
console.log(`Clicked on rating with id: ${ratingType.id}`);
|
|
}
|
|
|
|
return (
|
|
<Paper elevation={4}>
|
|
<Card>
|
|
<CardActionArea onClick={handleClick}>
|
|
<CardContent>
|
|
<Typography gutterBottom variant="h5" component="div">
|
|
Rating vom: {ratingType.date}
|
|
</Typography>
|
|
<Rating name="half-rating" readOnly defaultValue={ratingType.rating} precision={0.5} />
|
|
<Typography variant="body2" sx={{ color: 'text.secondary' }} className="item-description">
|
|
{ratingType.text}
|
|
</Typography>
|
|
</CardContent>
|
|
</CardActionArea>
|
|
</Card>
|
|
</Paper>
|
|
);
|
|
} |