import { Button } from '@heroui/button'; import { Spinner } from '@heroui/spinner'; import { QRCodeSVG } from 'qrcode.react'; import { IoAlertCircle, IoRefresh } from 'react-icons/io5'; interface QrCodeLoginProps { qrcode: string; loginError?: string; onRefresh?: () => void; } const QrCodeLogin: React.FC = ({ qrcode, loginError, onRefresh }) => { return (
{loginError ? (
登录失败
{loginError}
{onRefresh && ( )}
) : ( <>
{!qrcode && (
)}
请使用QQ或者TIM扫描上方二维码
{onRefresh && qrcode && ( )} )}
); }; export default QrCodeLogin;