ionian/src/client/page/reader/manga.tsx

28 lines
1.1 KiB
TypeScript
Raw Normal View History

2021-01-06 20:16:27 +09:00
import React, {useState, useEffect} from 'react';
import {Redirect, Route ,Switch,useHistory, useRouteMatch, match as MatchType, Link as RouterLink} from 'react-router-dom';
2021-01-06 22:09:53 +09:00
import { LoadingCircle } from '../../component/loading';
2021-01-06 20:16:27 +09:00
import { Link, Paper, makeStyles, Theme, Box, Typography } from '@material-ui/core';
2021-01-06 22:09:53 +09:00
import { Content, makeThumbnailUrl } from '../../accessor/contents';
2021-01-06 20:16:27 +09:00
type MangaType = "manga"|"artist cg"|"donjinshi"|"western"
export type PresentableTag = {
artist:string[],
group: string[],
series: string[],
type: MangaType,
character: string[],
tags: string[],
}
export const MangaReader = (props:{content:Content})=>{
const additional = props.content.additional;
if(!('page' in additional)){
console.error("invalid content : page read fail : "+ JSON.stringify(additional));
return <Typography>Error. DB error. page restriction</Typography>
}
const page:number = additional['page'] as number;
2021-01-08 17:26:38 +09:00
return (<div>{[...Array(page).keys()].map(x=>(<img src={`/content/${props.content.id}/manga/${x}`} key={x} style={{maxHeight:'100%',maxWidth:'100%'}}></img>))}</div>);
2021-01-06 20:16:27 +09:00
}
export default MangaReader;