diff --git a/src/share/Footer.tsx b/src/share/Footer.tsx index 4dcd3fb..14f5e47 100644 --- a/src/share/Footer.tsx +++ b/src/share/Footer.tsx @@ -1,7 +1,7 @@ 'use client' import { Button } from '@/components/ui/button' import { Separator } from '@/components/ui/separator' -import { Call, Location, Sms } from 'iconsax-react' +import { Call, Location, Sms, Share } from 'iconsax-react' import Image from 'next/image' import Link from 'next/link' import { FC } from 'react' @@ -111,19 +111,34 @@ const Footer: FC = () => {
- {siteSetting.results.siteSetting.socialMediaLinks.map((social) => ( - -
- social media -
- - ))} + {siteSetting.results.siteSetting.socialMediaLinks.map((social) => { + const isValidUrl = (str: string) => { + try { + new URL(str) + return true + } catch { + return false + } + } + + return ( + +
+ {isValidUrl(social.icon) ? ( + social media + ) : ( + + )} +
+ + ) + })}
)}