import { Operation } from './Operation'

export const Encabezados = [
    {
        name: 'pass',
        numeric: false,
        disablePadding: true,
        label: 'Contraseña',
    },
    {
        name: 'name',
        numeric: false,
        disablePadding: true,
        label: 'Nombre',
    },
    {
        name: 'apell',
        numeric: false,
        disablePadding: true,
        label: 'Apellido',
    },
    {
        name: 'mail',
        numeric: false,
        disablePadding: true,
        label: 'Correo',
    },
    {
        name: 'op',
        numeric: false,
        disablePadding: true,
        label: 'Operación',
        options: {
            filter: false,
            sort: false,
        }
    },
]

export const niveles_educativos = [
    "Primaria",
    "Basico",
    "Diversificado",
    "Tecnico",
    "Pregrado / Licenciatura",
    "Postgrado / Maestria",
    "Doctorado",
    "Diplomado",
    "Certificacion",
    "Cursos"
]

export function Build(pwds) {
    return pwds.map(password => {
        let { candidato: user, plaza_id, pwd } = password
        return {
            pass: pwd ? atob(pwd): '',
            name: user.nombre,
            apell: user.apellidos,
            mail: user.mail,
            op: <Operation plz={plaza_id} pwd={pwd} />
        }
    })
}

