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

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

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

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

  return { getTitle }
}
