main layout
This commit is contained in:
104
src/components/ui/AgentCard.tsx
Normal file
104
src/components/ui/AgentCard.tsx
Normal file
@@ -0,0 +1,104 @@
|
||||
'use client';
|
||||
|
||||
import Image from 'next/image';
|
||||
|
||||
interface AgentCardProps {
|
||||
name: string;
|
||||
title: string;
|
||||
location: string;
|
||||
rating?: number;
|
||||
reviewCount?: number;
|
||||
experience: string;
|
||||
expertise: string[];
|
||||
imageUrl: string;
|
||||
isVerified?: boolean;
|
||||
isFeatured?: boolean;
|
||||
}
|
||||
|
||||
export function AgentCard({
|
||||
name,
|
||||
title,
|
||||
location,
|
||||
rating,
|
||||
reviewCount,
|
||||
experience,
|
||||
expertise,
|
||||
imageUrl,
|
||||
isVerified = false,
|
||||
isFeatured = false,
|
||||
}: AgentCardProps) {
|
||||
return (
|
||||
<div className={`bg-white rounded-2xl shadow-lg overflow-hidden hover:shadow-xl transition-shadow ${isFeatured ? 'border-2 border-[#f5a623]' : ''}`}>
|
||||
{/* Image */}
|
||||
<div className="relative h-64 bg-gray-100">
|
||||
<Image
|
||||
src={imageUrl}
|
||||
alt={name}
|
||||
fill
|
||||
className="object-cover"
|
||||
/>
|
||||
{isVerified && (
|
||||
<div className="absolute top-3 left-3 bg-[#00293d] text-white text-xs px-2 py-1 rounded-full flex items-center gap-1">
|
||||
<svg className="w-3 h-3" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fillRule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clipRule="evenodd" />
|
||||
</svg>
|
||||
Verified Agent
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Content */}
|
||||
<div className="p-5">
|
||||
<h3 className="font-bold text-lg text-[#00293d]">{name}</h3>
|
||||
<p className="text-gray-600 text-sm mb-2">{title}</p>
|
||||
|
||||
{/* Location */}
|
||||
<div className="flex items-center gap-1 text-gray-500 text-sm mb-3">
|
||||
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" />
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 11a3 3 0 11-6 0 3 3 0 016 0z" />
|
||||
</svg>
|
||||
{location}
|
||||
</div>
|
||||
|
||||
{/* Rating */}
|
||||
{rating && (
|
||||
<div className="flex items-center gap-2 mb-3">
|
||||
<div className="flex">
|
||||
{[...Array(5)].map((_, i) => (
|
||||
<svg
|
||||
key={i}
|
||||
className={`w-4 h-4 ${i < Math.floor(rating) ? 'text-[#f5a623]' : 'text-gray-300'}`}
|
||||
fill="currentColor"
|
||||
viewBox="0 0 20 20"
|
||||
>
|
||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" />
|
||||
</svg>
|
||||
))}
|
||||
</div>
|
||||
{reviewCount && (
|
||||
<span className="text-sm text-gray-500">({reviewCount} reviews)</span>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Expertise Tags */}
|
||||
<div className="flex flex-wrap gap-2 mb-3">
|
||||
{expertise.slice(0, 3).map((tag) => (
|
||||
<span
|
||||
key={tag}
|
||||
className="bg-[#c4d9d4]/30 text-[#00293d] text-xs px-2 py-1 rounded-full"
|
||||
>
|
||||
{tag}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Experience */}
|
||||
<p className="text-sm text-gray-600">
|
||||
<span className="font-medium">Experience:</span> {experience}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
40
src/components/ui/Button.tsx
Normal file
40
src/components/ui/Button.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
'use client';
|
||||
|
||||
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
||||
|
||||
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
variant?: 'primary' | 'secondary' | 'outline';
|
||||
size?: 'sm' | 'md' | 'lg';
|
||||
children: ReactNode;
|
||||
}
|
||||
|
||||
export function Button({
|
||||
variant = 'primary',
|
||||
size = 'md',
|
||||
children,
|
||||
className = '',
|
||||
...props
|
||||
}: ButtonProps) {
|
||||
const baseStyles = 'font-medium rounded-lg transition-all duration-200 inline-flex items-center justify-center';
|
||||
|
||||
const variants = {
|
||||
primary: 'bg-[#f5a623] text-white hover:bg-[#e09620] active:bg-[#c98a1c]',
|
||||
secondary: 'bg-[#00293d] text-white hover:bg-[#003a57] active:bg-[#001f2e]',
|
||||
outline: 'border-2 border-[#00293d] text-[#00293d] hover:bg-[#00293d] hover:text-white',
|
||||
};
|
||||
|
||||
const sizes = {
|
||||
sm: 'px-4 py-2 text-sm',
|
||||
md: 'px-6 py-3 text-base',
|
||||
lg: 'px-8 py-4 text-lg',
|
||||
};
|
||||
|
||||
return (
|
||||
<button
|
||||
className={`${baseStyles} ${variants[variant]} ${sizes[size]} ${className}`}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
29
src/components/ui/Input.tsx
Normal file
29
src/components/ui/Input.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
'use client';
|
||||
|
||||
import { InputHTMLAttributes, ReactNode } from 'react';
|
||||
|
||||
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
||||
label?: string;
|
||||
icon?: ReactNode;
|
||||
}
|
||||
|
||||
export function Input({ label, icon, className = '', ...props }: InputProps) {
|
||||
return (
|
||||
<div className="flex flex-col gap-1">
|
||||
{label && (
|
||||
<label className="text-sm font-medium text-[#00293d]">{label}</label>
|
||||
)}
|
||||
<div className="relative">
|
||||
{icon && (
|
||||
<span className="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400">
|
||||
{icon}
|
||||
</span>
|
||||
)}
|
||||
<input
|
||||
className={`w-full px-4 py-3 rounded-lg border border-gray-200 focus:border-[#00293d] focus:ring-2 focus:ring-[#00293d]/20 outline-none transition-all ${icon ? 'pl-10' : ''} ${className}`}
|
||||
{...props}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
43
src/components/ui/Select.tsx
Normal file
43
src/components/ui/Select.tsx
Normal file
@@ -0,0 +1,43 @@
|
||||
'use client';
|
||||
|
||||
import { SelectHTMLAttributes } from 'react';
|
||||
|
||||
interface SelectOption {
|
||||
value: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
|
||||
label?: string;
|
||||
options: SelectOption[];
|
||||
placeholder?: string;
|
||||
}
|
||||
|
||||
export function Select({
|
||||
label,
|
||||
options,
|
||||
placeholder = 'Select...',
|
||||
className = '',
|
||||
...props
|
||||
}: SelectProps) {
|
||||
return (
|
||||
<div className="flex flex-col gap-1">
|
||||
{label && (
|
||||
<label className="text-sm font-medium text-[#00293d]">{label}</label>
|
||||
)}
|
||||
<select
|
||||
className={`w-full px-4 py-3 rounded-lg border border-gray-200 focus:border-[#00293d] focus:ring-2 focus:ring-[#00293d]/20 outline-none transition-all bg-white appearance-none cursor-pointer ${className}`}
|
||||
{...props}
|
||||
>
|
||||
<option value="" disabled>
|
||||
{placeholder}
|
||||
</option>
|
||||
{options.map((option) => (
|
||||
<option key={option.value} value={option.value}>
|
||||
{option.label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user