Skip to content
This repository was archived by the owner on Mar 19, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
'use client';

import React from 'react';
import { Business } from '@/types/business';

interface BusinessCardProps {
business: Business;
onViewDetails?: (business: Business) => void;
}

const BusinessCard: React.FC<BusinessCardProps> = ({ business, onViewDetails }) => {
const formatDate = (dateString: string) => {
return new Date(dateString).toLocaleDateString('en-US', {
year: 'numeric',
month: 'short',
day: 'numeric',
});
};

return (
<div className="bg-white rounded-2xl shadow-sm border border-gray-100 hover:shadow-md transition-shadow duration-200">
<div className="p-6">
{/* Header with logo and verification status */}
<div className="flex items-start justify-between mb-4">
<div className="flex items-center gap-3">
<div className="relative">
<img

Check warning on line 27 in src/app/(auth)/dashboard/business-requests/_components/BusinessCard.tsx

View workflow job for this annotation

GitHub Actions / Lint

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
src={business.logo || '/assets/images/avatar-default.png'}
alt={business.businessName}
className="w-16 h-16 rounded-full object-cover border-2 border-gray-100"
/>
{business.isVerified && (
<div className="absolute -bottom-1 -right-1 bg-blue-500 rounded-full p-1">
<svg className="w-3 h-3 text-white" 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>
</div>
)}
</div>
<div>
<h3 className="font-bold text-lg text-gray-900">{business.businessName}</h3>
<p className="text-sm text-gray-500">{business.businessSector}</p>
</div>
</div>
</div>

{/* Business details */}
<div className="space-y-3 mb-4">
<div className="flex items-center gap-2 text-sm text-gray-600">
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M3 8l7.89 4.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
/>
</svg>
<span>{business.email}</span>
</div>

<div className="flex items-center gap-2 text-sm text-gray-600">
<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>
<span className="truncate">{business.address}</span>
</div>

{business.description && (
<p className="text-sm text-gray-600 line-clamp-2">{business.description}</p>
)}
</div>

{/* Stats */}
<div className="grid grid-cols-2 gap-4 mb-4">
<div className="text-center p-3 bg-gray-50 rounded-lg">
<div className="text-lg font-bold text-gray-900">{business.employees?.length || 0}</div>
<div className="text-xs text-gray-500">Employees</div>
</div>
<div className="text-center p-3 bg-gray-50 rounded-lg">
<div className="text-lg font-bold text-gray-900">{business.courses?.length || 0}</div>
<div className="text-xs text-gray-500">Courses</div>
</div>
</div>

{/* Footer */}
<div className="flex items-center justify-between pt-4 border-t border-gray-100">
<div className="text-xs text-gray-500">Created: {formatDate(business.createdAt)}</div>
<button
onClick={() => onViewDetails?.(business)}
className="px-2 py-2 text-sm font-medium text-blue-600 hover:text-blue-700 hover:bg-blue-50 rounded-lg transition-colors duration-200"
>
View Details
</button>
</div>
</div>
</div>
);
};

export default BusinessCard;
Loading
Loading