2024-12-18 12:35:17 +03:00
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
import clsx from 'clsx';
|
|
|
|
|
import { QRCodeSVG } from 'qrcode.react';
|
|
|
|
|
|
2025-01-16 16:31:03 +03:00
|
|
|
import Modal from '@/components/ui/Modal';
|
|
|
|
|
import { useDialogsStore } from '@/stores/dialogs';
|
2024-12-18 12:35:17 +03:00
|
|
|
|
2025-01-16 16:31:03 +03:00
|
|
|
export interface DlgShowQRProps {
|
2024-12-18 12:35:17 +03:00
|
|
|
target: string;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-16 16:31:03 +03:00
|
|
|
function DlgShowQR() {
|
|
|
|
|
const { target } = useDialogsStore(state => state.props as DlgShowQRProps);
|
2024-12-18 12:35:17 +03:00
|
|
|
return (
|
2025-01-16 16:31:03 +03:00
|
|
|
<Modal readonly className={clsx('w-[30rem]', 'py-12 pr-3 pl-6 flex gap-3 justify-center items-center')}>
|
2024-12-18 12:35:17 +03:00
|
|
|
<div className='bg-[#ffffff] p-4 border'>
|
|
|
|
|
<QRCodeSVG value={target} size={256} />
|
|
|
|
|
</div>
|
|
|
|
|
</Modal>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default DlgShowQR;
|