2024-03-10 17:36:22 +01:00
|
|
|
/*
|
|
|
|
|
* 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 Card from '@mui/material/Card';
|
|
|
|
|
import CardContent from '@mui/material/CardContent';
|
|
|
|
|
import Avatar from '@mui/material/Avatar';
|
|
|
|
|
import Button from '@mui/material/Button';
|
|
|
|
|
import { useTranslation } from 'react-i18next';
|
2024-04-14 15:50:12 +02:00
|
|
|
import Stack from '@mui/material/Stack';
|
2024-10-06 01:27:51 +02:00
|
|
|
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
2024-10-05 21:32:31 +02:00
|
|
|
import { CARD_STYLING } from '@/modules/tracker/Tracker.constants.ts';
|
|
|
|
|
import { TTrackerBase } from '@/modules/tracker/services/Trackers.ts';
|
2024-03-10 17:36:22 +01:00
|
|
|
|
2024-07-04 22:00:39 +02:00
|
|
|
export const TrackerUntrackedCard = ({
|
|
|
|
|
tracker,
|
|
|
|
|
onClick,
|
|
|
|
|
}: {
|
|
|
|
|
tracker: Pick<TTrackerBase, 'name' | 'icon'>;
|
|
|
|
|
onClick: () => void;
|
|
|
|
|
}) => {
|
2024-03-10 17:36:22 +01:00
|
|
|
const { t } = useTranslation();
|
|
|
|
|
|
|
|
|
|
return (
|
2024-03-29 16:54:53 +01:00
|
|
|
<Card sx={CARD_STYLING}>
|
2024-03-10 17:36:22 +01:00
|
|
|
<CardContent sx={{ padding: '0' }}>
|
2024-09-03 17:15:47 +02:00
|
|
|
<Stack
|
|
|
|
|
direction="row"
|
|
|
|
|
sx={{
|
|
|
|
|
gap: 3,
|
|
|
|
|
}}
|
|
|
|
|
>
|
2024-03-10 17:36:22 +01:00
|
|
|
<Avatar
|
|
|
|
|
alt={`${tracker.name}`}
|
|
|
|
|
src={requestManager.getValidImgUrlFor(tracker.icon)}
|
|
|
|
|
variant="rounded"
|
|
|
|
|
sx={{ width: 64, height: 64 }}
|
|
|
|
|
/>
|
|
|
|
|
<Button sx={{ flexGrow: '1' }} onClick={onClick}>
|
|
|
|
|
{t('tracking.action.button.add_tracking')}
|
|
|
|
|
</Button>
|
|
|
|
|
</Stack>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
);
|
|
|
|
|
};
|