Fix contact phone tel: links when API returns non-string values.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-08-13 21:04:51 +03:30
co-authored by Cursor
parent bfeb728ff0
commit 4e517fe3b2
+8 -5
View File
@@ -56,16 +56,19 @@ export default async function ContactPage() {
<div>
<p className="font-bold text-brand-ink">تلفن</p>
<div className="mt-1 space-y-1">
{phones.map((phone) => (
{phones.map((phone) => {
const phoneText = String(phone ?? "")
return (
<a
key={phone}
href={`tel:${phone.replace(/\s/g, "")}`}
key={phoneText}
href={`tel:${phoneText.replace(/\s/g, "")}`}
className="latin-digits block text-brand"
dir="ltr"
>
{phone}
{phoneText}
</a>
))}
)
})}
</div>
</div>