import { Stack, Typography, Container, Box, OutlinedInput, InputAdornment, Button } from '@mui/material'; import { useTheme } from '@mui/material/styles'; import SubCard from 'ui-component/cards/SubCard'; import inviteImage from 'assets/images/invite/cwok_casual_19.webp'; import { useState } from 'react'; import { API } from 'utils/api'; import { showError, copy } from 'utils/common'; const InviteCard = () => { const theme = useTheme(); const [inviteUl, setInviteUrl] = useState(''); const handleInviteUrl = async () => { if (inviteUl) { copy(inviteUl, '邀请链接'); return; } const res = await API.get('/api/user/aff'); const { success, message, data } = res.data; if (success) { let link = `${window.location.origin}/register?aff=${data}`; setInviteUrl(link); copy(link, '邀请链接'); } else { showError(message); } }; return ( invite 邀请奖励 分享您的邀请链接,邀请好友注册,即可获得奖励! } aria-describedby="helper-text-channel-quota-label" disabled={true} /> ); }; export default InviteCard;