import { Badge } from 'react-bootstrap'


const rowformatter = (educators) => {
    return [
    (rowIndex, fieldName)=>{
        const theEducator = educators[rowIndex]
        const value = theEducator[fieldName]
        return (<span>{value}</span>)
    },
    (rowIndex, fieldName)=>{
        const theEducator = educators[rowIndex]
        const value = theEducator[fieldName]
        return (<span>{value}</span>)
    },
    (rowIndex, fieldName)=>{
        const theEducator = educators[rowIndex]
        const value = theEducator[fieldName]
        return (<span>{value}</span>)
    },
    (rowIndex, fieldName)=>{
        const theEducator = educators[rowIndex]
        const value = theEducator[fieldName]
        return (<span>{value}</span>)
    },
    (rowIndex, fieldName)=>{
        const theEducator = educators[rowIndex]
        const value = theEducator[fieldName]
        return (<Badge pill variant={`${utilityStatusToVariant(value)}`}>&nbsp;</Badge>)
    },
    (rowIndex, fieldName)=>{
        const theEducator = educators[rowIndex]
        const value = theEducator[fieldName]
        return (<span>{value}</span>)
    }
    ]
}


const headers = [
    { name: "Educator Id", field: "EducatorPublicId", sortable: false },
    { name: "Educator Name", field: "EducatorName", sortable: false },
    { name: "Educator Contact No.", field: "PhoneNo", sortable: false },
    { name: "Educator Email Id", field: "Email", sortable: false },
    { name: "Status", field: "IsActive", sortable: false },
    { name: "# of Pat. mapped", field: "NumberOfPatientsMapped", sortable: false }
]



export { headers, rowformatter}


export const utilityStatusToVariant = (statusCode) => {
    if(statusCode === false){
        return 'secondary'
    }else {
        return 'success'        
    }
}
