export const useTitle = () => {
  const getTitle = (pathname: string) => {
    // Handle dynamic routes first
    if (pathname.startsWith('/survey-sale/') && pathname !== '/survey-sale/regist') {
      return '調査物件詳細'
    }

    if (pathname.startsWith('/inquiry/') && pathname !== '/inquiry/list' && pathname !== '/inquiry/regist') {
      return 'お問い合わせ詳細'
    }

    // Handle static routes
    switch (pathname) {
      case '/':
        return 'Hanasys 現地調査'
      case '/suitable':
        return '屋根材適合性の確認'
      case '/survey-sale':
        return '調査物件一覧'
      case '/survey-sale/regist':
        return '調査物件登録'
      case '/inquiry/list':
        return 'お問い合わせ'
      case '/inquiry/regist':
        return 'お問い合わせ登録'
      case '/pw-reset':
        return 'パスワードリセット'

      default:
        return 'Hanasys 現地調査'
    }
  }

  return { getTitle }
}
