import { FormItem, FormConfig } from '@/components/form-render/form-render-types'
import i18n from '@/locales'
const { t } = i18n.global
export const config: FormConfig = {
	layout: 'horizontal',
	colon: true,
	hideRequiredMark: false,
	labelAlign: 'right',
	scrollToFirstError: false,
	validateOnRuleChange: true,
	labelCol: {
		span: 4,
		offset: 0,
	},
}

export const formItems: FormItem[] = [
	{
		group: 'form',
		type: 'input',
		config: {
			autoLink: true,
			hasFeedback: false,
			label: t('pages.acl.role.form.add.filed.name'),
			name: 'name',
			required: true,
		},
		properties: {
			size: 'default',
			type: 'text',
			allowClear: true,
			bordered: true,
			showCount: true,
			placeholder: t('pages.acl.role.form.add.placeholder.name'),
		},
		rules: [],
	},
	{
		type: 'textarea',
		group: 'form',
		config: {
			autoLink: true,
			hasFeedback: false,
			label: t('pages.acl.role.form.add.filed.description'),
			name: 'description',
		},
		properties: {
			size: 'default',
			visibilityToggle: true,
			allowClear: true,
			bordered: true,
			showCount: true,
			autoSize: {
				minRows: 3,
				maxRows: 6,
			},
			minRows: 3,
			maxRows: 6,
			placeholder: t('pages.acl.role.form.add.placeholder.description'),
		},
		rules: [],
	},
]
