church-website/src/hooks/useLocationName.ts
Benno Tielen 6036af1099 init
2024-08-21 17:08:42 +02:00

12 lines
No EOL
247 B
TypeScript

import { Church } from '@/payload-types'
/**
* Get user friendly location name
*/
export const useLocationName = (location: string | Church) => {
if (typeof location == "string") {
return location
} else {
return location.name
}
}