) {
if (key === "Enter") {
addReview({
userid: userId,
comment: (target as HTMLInputElement).value,
star: -1
}).then(res => {
if (res === 0 || res === 1) {
(target as HTMLInputElement).value = ""; // clear the input
dirtyRefetch();
}
});
}
}
return (
<>
User Reviews
{reviews?.map(review =>
)}
{reviews?.length === 0 && (
Looks like nobody reviewed this user yet. You could be the first!
)}
>
);
}