mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-03 19:04:39 -05:00
manga details done
This commit is contained in:
24
webUI/react/src/components/MangaDetails.tsx
Normal file
24
webUI/react/src/components/MangaDetails.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
|
||||
interface IProps{
|
||||
id: string
|
||||
}
|
||||
|
||||
export default function MangaDetails(props: IProps) {
|
||||
const { id } = props;
|
||||
const [manga, setManga] = useState<IManga>();
|
||||
|
||||
useEffect(() => {
|
||||
fetch(`http://127.0.0.1:4567/api/v1/manga/${id}/`)
|
||||
.then((response) => response.json())
|
||||
.then((data) => setManga(data));
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<h1>
|
||||
{manga && manga.title}
|
||||
</h1>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user