11import { sectionFields } from "@/fields/sectionFields"
2- import type { Block } from "payload"
2+ import type { Block , Field } from "payload"
3+
4+ function cardContentFields ( name : string , label : string ) : Field {
5+ return {
6+ name,
7+ label,
8+ type : "group" ,
9+ fields : [
10+ {
11+ name : "title" ,
12+ type : "text" ,
13+ localized : true ,
14+ } ,
15+ {
16+ name : "description" ,
17+ type : "textarea" ,
18+ localized : true ,
19+ } ,
20+ {
21+ name : "link" ,
22+ label : "Link" ,
23+ type : "group" ,
24+ fields : [
25+ {
26+ name : "label" ,
27+ type : "text" ,
28+ localized : true ,
29+ } ,
30+ {
31+ name : "url" ,
32+ type : "text" ,
33+ } ,
34+ ] ,
35+ } ,
36+ ] ,
37+ }
38+ }
339
440export const BentoBlock : Block = {
541 slug : "bento" ,
@@ -26,5 +62,33 @@ export const BentoBlock: Block = {
2662 } ,
2763 ] ,
2864 } ,
65+ {
66+ name : "featureContent" ,
67+ label : "Feature cards" ,
68+ type : "group" ,
69+ admin : {
70+ condition : ( _ , siblingData ) => siblingData ?. variant === "feature" ,
71+ } ,
72+ fields : [
73+ cardContentFields ( "projects" , "Projects" ) ,
74+ cardContentFields ( "roleSystem" , "Role System" ) ,
75+ cardContentFields ( "organizations" , "Organizations" ) ,
76+ cardContentFields ( "memberManagement" , "Member Management" ) ,
77+ ] ,
78+ } ,
79+ {
80+ name : "runtimeContent" ,
81+ label : "Runtime cards" ,
82+ type : "group" ,
83+ admin : {
84+ condition : ( _ , siblingData ) => siblingData ?. variant === "runtime" ,
85+ } ,
86+ fields : [
87+ cardContentFields ( "nodes" , "Nodes" ) ,
88+ cardContentFields ( "suggestionMenu" , "Suggestion Menu" ) ,
89+ cardContentFields ( "actionList" , "Action List" ) ,
90+ cardContentFields ( "runtimeTypes" , "Runtime Types" ) ,
91+ ] ,
92+ } ,
2993 ] ,
3094}
0 commit comments