

export const rowformatter = (visitors, isPatient) => (
    isPatient ?
    [
        (rowIndex, fieldName)=>{
            const theVisitor = visitors[rowIndex]
            const value = theVisitor[fieldName]
            return (<span>{value}</span>)
        },
        (rowIndex, fieldName)=>{
            const theVisitor = visitors[rowIndex]
            const value = theVisitor[fieldName]
            return (<span>{value}</span>)
        },
        (rowIndex, fieldName)=>{
            const theVisitor = visitors[rowIndex]
            const value = theVisitor[fieldName]
            return (<span>{value}</span>)
        }
        
    ]:[
        (rowIndex, fieldName)=>{
            const theVisitor = visitors[rowIndex]
            const value = theVisitor[fieldName]
            return (<span>{value}</span>)
        },
        (rowIndex, fieldName)=>{
            const theVisitor = visitors[rowIndex]
            const value = theVisitor[fieldName]
            return (<span>{value}</span>)
        },
        (rowIndex, fieldName)=>{
            const theVisitor = visitors[rowIndex]
            const value = theVisitor[fieldName]
            return (<span>{value}</span>)        
        },
        (rowIndex, fieldName)=>{
            const theVisitor = visitors[rowIndex]
            const value = theVisitor[fieldName]
            return (<span>{value}</span>)
        }
    ]
)

export const headers = (isPatient) => (
    isPatient ? 
    [    
        { name: "Visitor Name", field: "VisitorName", sortable: true },
        { name: "Phone Number", field: "PhoneNo", sortable: true },
        { name: "Email", field: "Email", sortable: true },
    ]:[
        { name: "Visitor Name", field: "VisitorName", sortable: true },
        { name: "Phone Number", field: "PhoneNo", sortable: true },
        { name: "Patients Name", field: "PatientName", sortable: false},        
        { name: "Email", field: "Email", sortable: true },
    ]
)

