route handlers for account/main
This commit is contained in:
15
frontend/lib/utils/pathMapper.ts
Normal file
15
frontend/lib/utils/pathMapper.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { SourceType } from '@/app/types'
|
||||
|
||||
const pathToSourceMap: Record<string, SourceType> = {
|
||||
techSupport: 'contact-us', // берем в кавычки значение с дефисом
|
||||
account: 'account',
|
||||
}
|
||||
|
||||
export const getSourceFromPath = (pathname: string): SourceType => {
|
||||
const cleanPath = pathname.replace(/^\//, '')
|
||||
|
||||
const source = pathToSourceMap[cleanPath] || 'contact-us' // дефолтное значение
|
||||
// console.log('Final source:', source)
|
||||
|
||||
return source
|
||||
}
|
||||
Reference in New Issue
Block a user