gitscope
← marzneshin / v0.7.0 / dashboard/src/modules/settings/certificate-button/index.tsx
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/modules/settings/certificate-button/index.tsx · TypeScript
Blame Raw
 1import { useTranslation } from 'react-i18next';
 2import { useCertificateQuery } from '../api';
 3import { CopyToClipboardButton } from '@marzneshin/common/components';
 4import { ClipboardCopy } from 'lucide-react';
 5
 6export const CertificateButton = () => {
 7    const { t } = useTranslation();
 8    const { data: certificate } = useCertificateQuery();
 9
10    return (
11        <CopyToClipboardButton
12            text={certificate}
13            successMessage={t('page.settings.certificate.copied')}
14            copyIcon={ClipboardCopy}
15            copyLabel={t('page.settings.certificate.copy')}
16            errorLabel={t('page.settings.certificate.error')}
17        />
18    );
19};