import { EvWechat } from '../components/EvWechat';
import { toast } from 'react-toastify';

export const RedirectSuccess = ({ url }: { url: string }) => {
  return (
    <div className='flex flex-col items-center justify-center p-2'>
      <div className='flex flex-col  gap-2 mb-3'>
        <div className=' font-semibold'>创建成功</div>
        <a
          href={url}
          className='text-blue-600 hover:text-blue-800 transition-colors duration-200 hover:underline block truncate'
          target='_blank'
          rel='noopener noreferrer'>
          跳转到新应用
        </a>
      </div>
    </div>
  );
};

export const toastSuccess = (url: string) => {
  toast.success(<RedirectSuccess url={url} />, {
    autoClose: 5000,
    className: 'rounded-md shadow-lg',
    // icon: false,
  });
};

export const toastWeChat = () => {
  toast.success(<EvWechat />, {
    autoClose: 10000,
    className: 'rounded-md shadow-lg',
    icon: false,
  });
};
