gitscope
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/features/users/dialogs/settings/user-info/qrcode.tsx · v0.3.0-alpha4
Source
1 857e289 Mrdn 2y ago
2 857e289 Mrdn 2y ago import { UserType } from '@marzneshin/features/users';
3 857e289 Mrdn 2y ago import QRCode from "react-qr-code";
4 857e289 Mrdn 2y ago import { QrCodeIcon } from "lucide-react";
5 857e289 Mrdn 2y ago import { FC } from 'react'
6 857e289 Mrdn 2y ago import { Card, CardContent, CardHeader, CardTitle } from '@marzneshin/components';
7 857e289 Mrdn 2y ago import { useTranslation } from 'react-i18next';
8 857e289 Mrdn 2y ago import { SubscriptionLinkButton } from './subcription-link-button';
9 912d3dc Mrdn 2y ago import { getSubscriptionLink } from '@marzneshin/utils';
10 857e289 Mrdn 2y ago
11 857e289 Mrdn 2y ago interface QRCodeProps {
12 857e289 Mrdn 2y ago entity: UserType
13 857e289 Mrdn 2y ago }
14 857e289 Mrdn 2y ago
15 857e289 Mrdn 2y ago export const QRCodeSection: FC<QRCodeProps> = (
16 857e289 Mrdn 2y ago { entity }
17 857e289 Mrdn 2y ago ) => {
18 912d3dc Mrdn 2y ago const subscribeQrLink = getSubscriptionLink(entity.subscription_url);
19 857e289 Mrdn 2y ago const { t } = useTranslation()
20 857e289 Mrdn 2y ago return (
21 857e289 Mrdn 2y ago <Card>
22 857e289 Mrdn 2y ago <CardHeader>
23 857e289 Mrdn 2y ago <CardTitle className="flex flex-row gap-4 justify-start">
24 857e289 Mrdn 2y ago <QrCodeIcon />
25 857e289 Mrdn 2y ago {t('subscription')}
26 857e289 Mrdn 2y ago </CardTitle>
27 857e289 Mrdn 2y ago </CardHeader>
28 857e289 Mrdn 2y ago <CardContent className='flex flex-col justify-center items-center py-10 w-full h-full'>
29 857e289 Mrdn 2y ago <div className="flex flex-col gap-3 justify-center items-center w-1/2 h-1/2">
30 857e289 Mrdn 2y ago <QRCode
31 857e289 Mrdn 2y ago size={150}
32 857e289 Mrdn 2y ago className="w-full h-full"
33 857e289 Mrdn 2y ago value={subscribeQrLink}
34 857e289 Mrdn 2y ago />
35 857e289 Mrdn 2y ago <SubscriptionLinkButton subscriptionLink={subscribeQrLink} />
36 857e289 Mrdn 2y ago </div>
37 857e289 Mrdn 2y ago </CardContent>
38 857e289 Mrdn 2y ago </Card>
39 857e289 Mrdn 2y ago );
40 857e289 Mrdn 2y ago }