All checks were successful
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
22 lines
893 B
TypeScript
22 lines
893 B
TypeScript
import type { GlobalConfig } from 'payload'
|
||
|
||
export const SiteSettings: GlobalConfig = {
|
||
slug: 'site-settings',
|
||
label: 'Контакты и соцсети',
|
||
access: { read: () => true },
|
||
fields: [
|
||
{ name: 'email', label: 'Почта для связи', type: 'email' },
|
||
{ name: 'phone', label: 'Телефон', type: 'text' },
|
||
{ name: 'address', label: 'Адрес', type: 'text', localized: true },
|
||
{
|
||
name: 'socials',
|
||
label: 'Социальные сети',
|
||
type: 'array',
|
||
fields: [
|
||
{ name: 'label', label: 'Название (например, Instagram)', type: 'text', required: true },
|
||
{ name: 'url', label: 'Ссылка', type: 'text', required: true, validate: (v: string | null | undefined) => (v && /^https?:\/\//.test(v) ? true : 'Ссылка должна начинаться с https://') },
|
||
],
|
||
},
|
||
],
|
||
}
|