import Taro, { useRouter } from '@tarojs/taro'
import { useEffect, useMemo } from 'react'
import { View, Text } from '@tarojs/components'
import './index.scss'

function FeaturePage() {
  const { params } = useRouter()

  const title = useMemo(() => {
    const raw = params?.title || '功能'
    try {
      return decodeURIComponent(raw)
    } catch {
      return raw
    }
  }, [params?.title])

  useEffect(() => {
    Taro.setNavigationBarTitle({ title })
  }, [title])

  return (
    <View className="feature-page">
      <View className="feature-card">
        <Text className="feature-title">{title}</Text>
        <Text className="feature-desc">这是占位页面，可在此接入实际业务功能与路由。</Text>
      </View>
    </View>
  )
}

export default FeaturePage

