feat: add profile links to featured agents and professionals by updating CMS types and card components
This commit is contained in:
@@ -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 }) {
|
||||
|
||||
Reference in New Issue
Block a user