import { parseContentfulContentImage } from './contentImage'
import {Author, AuthorEntry} from "../../types/author";




export function parseContentfulAuthor(authorEntry?: AuthorEntry<any, any>): Author | null {
    if (!authorEntry) {
        return null
    }

    return {
        name: authorEntry.fields.name || '',
        expertId: authorEntry.fields.expertId || '',
        avatar: parseContentfulContentImage(authorEntry.fields.avatar),
    }
}