66 lines
1.2 KiB
TypeScript
66 lines
1.2 KiB
TypeScript
import { lucideOptions } from '@/lib/lucid-options'
|
|
import { revalidatePath } from 'next/cache'
|
|
import { GlobalConfig } from 'payload'
|
|
|
|
export const Home: GlobalConfig = {
|
|
slug: 'home',
|
|
access: {
|
|
read: () => true,
|
|
},
|
|
fields: [
|
|
{
|
|
name: 'mainLinks',
|
|
type: 'array',
|
|
required: true,
|
|
fields: [
|
|
{
|
|
name: 'title',
|
|
type: 'text',
|
|
required: true,
|
|
},
|
|
{
|
|
name: 'url',
|
|
type: 'text',
|
|
required: true,
|
|
},
|
|
{
|
|
name: 'icon',
|
|
type: 'select',
|
|
options: lucideOptions,
|
|
required: true,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'popoverLinks',
|
|
type: 'array',
|
|
required: true,
|
|
fields: [
|
|
{
|
|
name: 'title',
|
|
type: 'text',
|
|
required: true,
|
|
},
|
|
{
|
|
name: 'url',
|
|
type: 'text',
|
|
required: true,
|
|
},
|
|
{
|
|
name: 'icon',
|
|
type: 'select',
|
|
options: lucideOptions,
|
|
required: true,
|
|
},
|
|
],
|
|
},
|
|
],
|
|
hooks: {
|
|
afterChange: [
|
|
async () => {
|
|
revalidatePath('/')
|
|
},
|
|
],
|
|
},
|
|
}
|