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