import { WebView } from '@tarojs/components'
import { useRouter } from '@tarojs/taro'

export default function WebViewPage() {
  const router = useRouter()
  const { url } = router.params
  
  if (!url) return null
  
  // Ensure url has protocol if missing (e.g. starts with //)
  const fullUrl = url.startsWith('//') ? `https:${url}` : url
  
  return <WebView src={fullUrl} />
}
