15 lines
308 B
TypeScript
15 lines
308 B
TypeScript
import { Church } from '@/payload-types'
|
|
|
|
export const useLocation = (location: string | Church): Church => {
|
|
if (typeof location === 'string') {
|
|
return {
|
|
address: '',
|
|
createdAt: '',
|
|
name: 'Unknown',
|
|
updatedAt: '',
|
|
id: location,
|
|
}
|
|
} else {
|
|
return location
|
|
}
|
|
}
|