import {routes} from '../../../../../laravel-vuexy-admin/resources/assets/js/bootstrap-table/globalConfig.js';
export const contactActionFormatter = (value, row, index) => {
if (!row.id) return '';
const showUrl = routes['admin.contact.show'].replace(':id', row.id);
const editUrl = routes['admin.contact.edit'].replace(':id', row.id);
const deleteUrl = routes['admin.contact.delete'].replace(':id', row.id);
return `
`.trim();
};
export const agentFormatter = (value, row, index) => {
if (!row.agent_name) return '';
const email = row.agent_email || 'Sin correo';
const userUrl = routes['admin.user.show'].replace(':id', row.id);
return `
`;
};
export const contactParentFormatter = (value, row, index) => {
if (!row.parent_name) return '';
const email = row.parent_email || 'Sin correo';
const showUrl = routes['admin.contact.show'].replace(':id', row.id);
return `
`;
};
export const emailFormatter = (value, row, index) => {
if (!value) return '';
return `
${value}
`;
};
export const telFormatter = (value, row, index) => {
if (!value) return '';
return `
${value}
`;
};
export const direccionFormatter = (value, row, index) => {
let direccion = row.direccion ? row.direccion.trim() : '';
let numExt = row.num_ext ? ` #${row.num_ext}` : '';
let numInt = row.num_int ? `, Int. ${row.num_int}` : '';
let fullAddress = `${direccion}${numExt}${numInt}`.trim();
return fullAddress ? `${fullAddress}` : 'Sin dirección';
};