add chapter list

This commit is contained in:
Aria Moradi
2021-01-19 21:02:57 +03:30
parent 0b2d49f3f6
commit 9f75087f20
7 changed files with 82 additions and 23 deletions

View File

@@ -1,18 +1,11 @@
import React, { useEffect, useState } from 'react';
import React from 'react';
interface IProps{
id: string
manga: IManga | undefined
}
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));
}, []);
const { manga } = props;
return (
<>