add elements components
This commit is contained in:
29
components/elements/types.ts
Normal file
29
components/elements/types.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
export type FieldType =
|
||||
| "text"
|
||||
| "textarea"
|
||||
| "color"
|
||||
| "icon"
|
||||
| "array"
|
||||
| "object"
|
||||
| "boolean"
|
||||
| "select"
|
||||
|
||||
export interface FieldOption {
|
||||
label: string
|
||||
value: string
|
||||
}
|
||||
|
||||
export interface FieldConfig {
|
||||
type: FieldType
|
||||
label?: string
|
||||
options?: FieldOption[]
|
||||
arrayFields?: Record<string, FieldConfig>
|
||||
objectFields?: Record<string, FieldConfig>
|
||||
}
|
||||
|
||||
export interface ComponentConfig {
|
||||
label: string
|
||||
fields: Record<string, FieldConfig>
|
||||
}
|
||||
|
||||
export type ElementConfig = Record<string, ComponentConfig>
|
||||
Reference in New Issue
Block a user