Always show documents section in professional detail, with No subido fallback
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
b0e3467565
commit
aa35f4b661
@@ -382,49 +382,37 @@ export default function ProfessionalDetailPage() {
|
||||
</Card>
|
||||
|
||||
{/* Documentos subidos */}
|
||||
{(professional.identification_picture || professional.certificate_picture || professional.banner_picture) && (
|
||||
<Card>
|
||||
<CardHeader><CardTitle>Documentos y fotos</CardTitle></CardHeader>
|
||||
<CardContent className="grid grid-cols-1 gap-4 sm:grid-cols-3">
|
||||
{professional.identification_picture && (
|
||||
<div className="space-y-2">
|
||||
<p className="text-sm text-muted-foreground">Foto de cédula</p>
|
||||
{professional.identification_picture.match(/\.(jpg|jpeg|png|webp)$/i) ? (
|
||||
<a href={professional.identification_picture} target="_blank" rel="noreferrer">
|
||||
<img src={professional.identification_picture} alt="Cédula" className="rounded-lg border object-cover w-full max-h-48" />
|
||||
</a>
|
||||
<Card>
|
||||
<CardHeader><CardTitle>Documentos y fotos</CardTitle></CardHeader>
|
||||
<CardContent className="grid grid-cols-1 gap-4 sm:grid-cols-3">
|
||||
{(['identification_picture', 'certificate_picture', 'banner_picture'] as const).map((field) => {
|
||||
const labels: Record<string, string> = {
|
||||
identification_picture: 'Foto de cédula',
|
||||
certificate_picture: 'Certificado / Diploma',
|
||||
banner_picture: 'Foto de perfil / Banner',
|
||||
};
|
||||
const url = professional[field];
|
||||
return (
|
||||
<div key={field} className="space-y-2">
|
||||
<p className="text-sm text-muted-foreground">{labels[field]}</p>
|
||||
{url ? (
|
||||
url.match(/\.(jpg|jpeg|png|webp)$/i) ? (
|
||||
<a href={url} target="_blank" rel="noreferrer">
|
||||
<img src={url} alt={labels[field]} className="rounded-lg border object-cover w-full max-h-48" />
|
||||
</a>
|
||||
) : (
|
||||
<a href={url} target="_blank" rel="noreferrer" className="flex items-center gap-2 text-sm text-primary underline">
|
||||
<ExternalLink className="h-4 w-4" /> Ver documento
|
||||
</a>
|
||||
)
|
||||
) : (
|
||||
<a href={professional.identification_picture} target="_blank" rel="noreferrer" className="flex items-center gap-2 text-sm text-primary underline">
|
||||
<ExternalLink className="h-4 w-4" /> Ver documento
|
||||
</a>
|
||||
<p className="text-sm text-muted-foreground italic">No subido</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{professional.certificate_picture && (
|
||||
<div className="space-y-2">
|
||||
<p className="text-sm text-muted-foreground">Certificado / Diploma</p>
|
||||
{professional.certificate_picture.match(/\.(jpg|jpeg|png|webp)$/i) ? (
|
||||
<a href={professional.certificate_picture} target="_blank" rel="noreferrer">
|
||||
<img src={professional.certificate_picture} alt="Certificado" className="rounded-lg border object-cover w-full max-h-48" />
|
||||
</a>
|
||||
) : (
|
||||
<a href={professional.certificate_picture} target="_blank" rel="noreferrer" className="flex items-center gap-2 text-sm text-primary underline">
|
||||
<ExternalLink className="h-4 w-4" /> Ver documento
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{professional.banner_picture && (
|
||||
<div className="space-y-2">
|
||||
<p className="text-sm text-muted-foreground">Foto de perfil / Banner</p>
|
||||
<a href={professional.banner_picture} target="_blank" rel="noreferrer">
|
||||
<img src={professional.banner_picture} alt="Banner" className="rounded-lg border object-cover w-full max-h-48" />
|
||||
</a>
|
||||
</div>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
)}
|
||||
);
|
||||
})}
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Métodos de pago */}
|
||||
{professional.payment_methods && professional.payment_methods.length > 0 && (
|
||||
|
||||
Reference in New Issue
Block a user