mirror of
https://github.com/supabase/supabase.git
synced 2026-10-14 21:59:16 +03:00
* fix cms types and build --------- Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
29 lines
636 B
TypeScript
29 lines
636 B
TypeScript
import type { ArrayField, Field } from 'payload'
|
|
|
|
import type { LinkAppearances } from './link.ts'
|
|
|
|
import deepMerge from '../utilities/deepMerge.ts'
|
|
import { link } from './link.ts'
|
|
|
|
type LinkGroupType = (options?: {
|
|
appearances?: LinkAppearances[] | false
|
|
overrides?: Partial<ArrayField>
|
|
}) => Field
|
|
|
|
export const linkGroup: LinkGroupType = ({ appearances, overrides = {} } = {}) => {
|
|
const generatedLinkGroup: Field = {
|
|
name: 'links',
|
|
type: 'array',
|
|
fields: [
|
|
link({
|
|
appearances,
|
|
}),
|
|
],
|
|
admin: {
|
|
initCollapsed: true,
|
|
},
|
|
}
|
|
|
|
return deepMerge(generatedLinkGroup, overrides)
|
|
}
|