refactor: remove unused attendee detail components and provider
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import { MessageCircle, Phone } from 'lucide-react'
|
||||
import { formatPhoneDisplay } from '../../lib/format'
|
||||
import { cn } from '../../lib/utils'
|
||||
import { ACTION_BUTTON_CLASS } from './actionButton'
|
||||
import { useAttendeeDetail } from './AttendeeDetailProvider'
|
||||
|
||||
export function AttendeeContactActions() {
|
||||
const { attendee } = useAttendeeDetail()
|
||||
|
||||
const phone = attendee?.phone
|
||||
if (!phone) return null
|
||||
|
||||
// Los links van con los dígitos crudos: wa.me y tel: no entienden formatos.
|
||||
const digits = phone.replace(/\D/g, '')
|
||||
const label = formatPhoneDisplay(phone) ?? phone
|
||||
|
||||
return (
|
||||
<div className="flex gap-2.5">
|
||||
<a
|
||||
href={`https://wa.me/${digits}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
aria-label={`Abrir WhatsApp con ${label}`}
|
||||
className={cn(ACTION_BUTTON_CLASS, 'flex-1')}
|
||||
>
|
||||
<MessageCircle className="size-4 text-accent" aria-hidden="true" />
|
||||
WhatsApp
|
||||
</a>
|
||||
<a
|
||||
href={`tel:${digits}`}
|
||||
aria-label={`Llamar a ${label}`}
|
||||
className={cn(ACTION_BUTTON_CLASS, 'flex-1')}
|
||||
>
|
||||
<Phone className="size-4 text-accent" aria-hidden="true" />
|
||||
Llamar
|
||||
</a>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user