import { Card } from "flowbite-react"; import { ReleaseChips } from "../ReleasePoster/Chips"; import { Poster } from "../ReleasePoster/Poster"; import Link from "next/link"; const profile_lists = { // 0: "Не смотрю", 1: { name: "Смотрю", bg_color: "bg-green-500" }, 2: { name: "В планах", bg_color: "bg-purple-500" }, 3: { name: "Просмотрено", bg_color: "bg-blue-500" }, 4: { name: "Отложено", bg_color: "bg-yellow-500" }, 5: { name: "Брошено", bg_color: "bg-red-500" }, }; export const ProfileReleaseHistory = (props: any) => { return (

Недавно просмотренные

{props.history.map((release) => { const genres = []; const grade = release.grade ? Number(release.grade.toFixed(1)) : null; const profile_list_status = release.profile_list_status || null; let user_list = null; if (profile_list_status != null || profile_list_status != 0) { user_list = profile_lists[profile_list_status]; } if (release.genres) { const genres_array = release.genres.split(","); genres_array.forEach((genre) => { genres.push(genre.trim()); }); } return (
{genres.length > 0 && genres.map((genre: string, index: number) => { return ( {index > 0 && ", "} {genre} ); })}
{release.title_ru && (

{release.title_ru}

)} {release.title_original && (

{release.title_original}

)}
); })}
); };