import { View, Text } from '@tarojs/components';
import { navigateToLogin } from '../../utils/navigate';
import './index.scss';

interface GuestGuardProps {
  title: string;
  desc?: string;
}

export default function GuestGuard({ title, desc }: GuestGuardProps) {
  return (
    <View className='guard-page'>
      <View className='guard-card'>
        <View className='guard-icon-wrap'>
          <Text className='guard-icon'>锁</Text>
        </View>
        <Text className='guard-title'>{title}</Text>
        {desc && <Text className='guard-desc'>{desc}</Text>}
        <View
          className='guard-btn'
          onClick={navigateToLogin}
        >
          <Text className='guard-btn-text'>立即登录</Text>
        </View>
      </View>
    </View>
  );
}
