/* * Copyright (C) Contributors to the Suwayomi project * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import { CardActionArea, Box, styled } from '@mui/material'; import Avatar from '@mui/material/Avatar'; import Button from '@mui/material/Button'; import Card from '@mui/material/Card'; import CardContent from '@mui/material/CardContent'; import Typography from '@mui/material/Typography'; import React from 'react'; import { useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; import { TPartialSource } from '@/typings'; import { requestManager } from '@/lib/requests/RequestManager.ts'; import { translateExtensionLanguage } from '@/screens/util/Extensions'; import { SourceContentType } from '@/screens/SourceMangas'; const MobileWidthButtons = styled('div')(({ theme }) => ({ display: 'flex', [theme.breakpoints.up('sm')]: { display: 'none', }, })); const WiderWidthButtons = styled('div')(({ theme }) => ({ display: 'flex', [theme.breakpoints.down('sm')]: { display: 'none', }, '& .MuiButton-root': { marginLeft: '20px', }, })); interface IProps { source: TPartialSource; showSourceRepo: boolean; } export const SourceCard: React.FC = (props: IProps) => { const { t } = useTranslation(); const { source: { id, name, lang, iconUrl, supportsLatest, isNsfw, extension: { repo }, }, showSourceRepo, } = props; return ( {name} {id !== '0' && ( {translateExtensionLanguage(lang)} {isNsfw && ( {' 18+'} )} {showSourceRepo && ( {repo} )} )} <> {supportsLatest && ( )} {supportsLatest && ( )} ); };