feat: add profile links to featured agents and professionals by updating CMS types and card components

This commit is contained in:
pradeepkumar
2026-04-20 10:31:51 +05:30
parent ba8ce115b2
commit da805fbc5c
3 changed files with 37 additions and 15 deletions

View File

@@ -2,6 +2,7 @@
import { useState, useEffect } from 'react';
import Image from 'next/image';
import Link from 'next/link';
import type { FeaturesContent, FeaturedAgentItem } from '@/types/cms';
import { resolveImageUrl } from '@/services/cms.service';
@@ -21,8 +22,8 @@ function AgentCard({ agent, className = '' }: { agent: FeaturedAgentItem; classN
}
}, [agent.imageUrl]);
return (
<div className={`bg-white border border-[#00293d]/10 rounded-[15px] w-[254px] overflow-hidden ${className}`}>
const cardInner = (
<div className={`bg-white border border-[#00293d]/10 rounded-[15px] w-[254px] overflow-hidden ${agent.id ? 'hover:shadow-xl transition-shadow cursor-pointer' : ''} ${className}`}>
<div className="h-[161px] w-full overflow-hidden rounded-t-[15px] bg-gray-100 relative">
{imgSrc && (
<img
@@ -66,6 +67,11 @@ function AgentCard({ agent, className = '' }: { agent: FeaturedAgentItem; classN
</div>
</div>
);
if (agent.id) {
return <Link href={`/user/profile/${agent.id}`}>{cardInner}</Link>;
}
return cardInner;
}
export function FeaturesSection({ content }: { content?: FeaturesContent }) {