const admonitionTypeOptions = [
    {
        id: 'note',
        label: 'Note',
        value: 'note'
    },
    {
        id: 'tip',
        label: 'Tip',
        value: 'tip'
    },
    {
        id: 'warning',
        label: 'Warning',
        value: 'warning'
    },
    {
        id: 'danger',
        label: 'Danger',
        value: 'danger'
    }
];
function getInitialState(data) {
    return {
        title: {
            value: data?.title,
            initialValue: data?.title,
            valid: true
        },
        admonitionType: {
            value: data?.admonitionType ?? 'note',
            initialValue: data?.admonitionType ?? 'note',
            valid: true
        }
    };
}
function isTitleValid(value) {
    return null != value && value.length > 0;
}
function validateFields(fields) {
    let valid = true;
    if (null == fields) return {
        valid: false,
        fields: getInitialState({})
    };
    if (null != fields.title) if (false === isTitleValid(fields.title.value)) {
        fields.title.valid = false;
        valid = false;
    } else fields.title.valid = true;
    return {
        valid,
        fields
    };
}
export { admonitionTypeOptions, getInitialState, isTitleValid, validateFields };
