feat: update PostUnlock component to display contact information based on annuncio status
This commit is contained in:
parent
c6b462a54d
commit
79354f3833
1 changed files with 45 additions and 23 deletions
|
|
@ -276,7 +276,7 @@ function getNavigationUrl(lat: string, lon: string): string {
|
|||
|
||||
const PostUnlock = () => {
|
||||
const { servizioId } = useServizio();
|
||||
const { annuncioId } = useServizioAnnuncio();
|
||||
const { annuncioId, data: annuncio } = useServizioAnnuncio();
|
||||
const { data, isLoading } = api.annunci.getProprietarioData.useQuery({
|
||||
annuncioId,
|
||||
servizioId,
|
||||
|
|
@ -311,28 +311,50 @@ const PostUnlock = () => {
|
|||
<CredenzaBody className="max-h-[80vh] overflow-auto pb-5 sm:max-w-xl">
|
||||
<div className="space-y-10">
|
||||
{/* Proprietario Section */}
|
||||
<section>
|
||||
<h3 className="mb-2 font-semibold">{t.contatto.propietario}:</h3>
|
||||
<p className="mb-2">
|
||||
{t.contatto.nome}: {propData.locatore}
|
||||
{propData.tipo_locatore ? ` (${propData.tipo_locatore})` : ""}
|
||||
</p>
|
||||
<div className="flex flex-wrap items-center gap-5">
|
||||
<a
|
||||
className="flex items-center gap-2 text-blue-600 hover:underline"
|
||||
href={`tel:${propData.numero}`}
|
||||
>
|
||||
<Phone className="size-4" />
|
||||
<span>{propData.numero}</span>
|
||||
</a>
|
||||
<Link href={`https://wa.me/${propData.numero}`} target="_blank">
|
||||
<Button size="sm" variant="success">
|
||||
<WhatsAppIcon2 className="size-4 fill-white" />
|
||||
WhatsApp
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
</section>
|
||||
{annuncio.stato === "Sospeso" ? (
|
||||
<section>
|
||||
<h3 className="mb-2 font-semibold">{t.contatto.propietario}:</h3>
|
||||
<p className="mb-2">{t.contatto.nome}: INFOALLOGGI (delegato)</p>
|
||||
<div className="flex flex-wrap items-center gap-5">
|
||||
<a
|
||||
className="flex items-center gap-2 text-blue-600 hover:underline"
|
||||
href={`tel:3453944827`}
|
||||
>
|
||||
<Phone className="size-4" />
|
||||
<span>+39 3453944827</span>
|
||||
</a>
|
||||
<Link href={`https://wa.me/3453944827`} target="_blank">
|
||||
<Button size="sm" variant="success">
|
||||
<WhatsAppIcon2 className="size-4 fill-white" />
|
||||
WhatsApp
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
</section>
|
||||
) : (
|
||||
<section>
|
||||
<h3 className="mb-2 font-semibold">{t.contatto.propietario}:</h3>
|
||||
<p className="mb-2">
|
||||
{t.contatto.nome}: {propData.locatore}
|
||||
{propData.tipo_locatore ? ` (${propData.tipo_locatore})` : ""}
|
||||
</p>
|
||||
<div className="flex flex-wrap items-center gap-5">
|
||||
<a
|
||||
className="flex items-center gap-2 text-blue-600 hover:underline"
|
||||
href={`tel:${propData.numero}`}
|
||||
>
|
||||
<Phone className="size-4" />
|
||||
<span>{propData.numero}</span>
|
||||
</a>
|
||||
<Link href={`https://wa.me/${propData.numero}`} target="_blank">
|
||||
<Button size="sm" variant="success">
|
||||
<WhatsAppIcon2 className="size-4 fill-white" />
|
||||
WhatsApp
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
</section>
|
||||
)}
|
||||
|
||||
{/* Immobile Section */}
|
||||
<section>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue