2024-10-18 02:10:58 +02:00
|
|
|
import IMangaConnector from "./IMangaConnector";
|
|
|
|
import KeyValuePair from "./KeyValuePair";
|
|
|
|
import {Manga} from "../Manga";
|
|
|
|
import {ReactElement} from "react";
|
|
|
|
|
|
|
|
export default interface IManga{
|
|
|
|
"sortName": string,
|
|
|
|
"authors": string[],
|
|
|
|
"altTitles": KeyValuePair[],
|
|
|
|
"description": string,
|
|
|
|
"tags": string[],
|
|
|
|
"coverUrl": string,
|
|
|
|
"coverFileNameInCache": string,
|
|
|
|
"links": KeyValuePair[],
|
|
|
|
"year": number,
|
|
|
|
"originalLanguage": string,
|
|
|
|
"releaseStatus": number,
|
|
|
|
"folderName": string,
|
|
|
|
"publicationId": string,
|
|
|
|
"internalId": string,
|
|
|
|
"ignoreChaptersBelow": number,
|
|
|
|
"latestChapterDownloaded": number,
|
|
|
|
"latestChapterAvailable": number,
|
|
|
|
"websiteUrl": string,
|
|
|
|
"mangaConnector": IMangaConnector
|
|
|
|
}
|
|
|
|
|
2024-10-18 19:43:13 +02:00
|
|
|
function ReleaseStatusFromNumber(n: number): string {
|
|
|
|
switch(n) {
|
|
|
|
case 0: return "Ongoing";
|
|
|
|
case 1: return "Completed";
|
|
|
|
case 2: return "OnHiatus";
|
|
|
|
case 3: return "Cancelled";
|
|
|
|
case 4: return "Unreleased";
|
|
|
|
}
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
2024-10-18 02:10:58 +02:00
|
|
|
export function HTMLFromIManga(manga: IManga) : ReactElement {
|
2024-10-18 19:43:13 +02:00
|
|
|
return(
|
|
|
|
<div className="Manga" key={manga.internalId}>
|
|
|
|
<img src={Manga.GetMangaCoverUrl(manga.internalId)}></img>
|
|
|
|
<div>
|
|
|
|
<p className="pill connector-name">{manga.mangaConnector.name}</p>
|
|
|
|
<div className="Manga-status" release-status={ReleaseStatusFromNumber(manga.releaseStatus)}></div>
|
2024-10-19 16:28:49 +02:00
|
|
|
<p className="Manga-name">{manga.sortName}</p>
|
2024-10-18 19:43:13 +02:00
|
|
|
</div>
|
|
|
|
</div>);
|
2024-10-18 02:10:58 +02:00
|
|
|
}
|