import React from 'react'; import { TranslateStatus } from '../../api/api'; import { Link } from 'react-router-dom'; import './NovelItem.sass'; import {capitalize, generateClassName} from "../../utils"; type Props = { id: number original_name: string viewType: string novelId?: number localized_name?: string image?: string status?: string mark?: number } const NovelItem = ({ id, original_name, localized_name, image, status, mark, viewType, novelId }: Props) => ( {viewType === 'grid' && (<>
{localized_name || original_name}
{status &&
{TranslateStatus[status]} {mark !== undefined && mark > 0 && mark}
} )} {viewType === 'table' && (<>
{novelId || ''}
{localized_name || original_name}
{status &&
{TranslateStatus[status]} {mark !== undefined && mark > 0 && mark}
} )} ); export default NovelItem;