mirror of
https://github.com/SamyRai/turash.git
synced 2025-12-26 23:01:33 +00:00
- Remove nested git repository from bugulma/frontend/.git - Add all frontend files to main repository tracking - Convert from separate frontend/backend repos to unified monorepo - Preserve all frontend code and development history as tracked files - Eliminate nested repository complexity for simpler development workflow This creates a proper monorepo structure with frontend and backend coexisting in the same repository for easier development and deployment.
51 lines
1.5 KiB
TypeScript
51 lines
1.5 KiB
TypeScript
import React, { useCallback } from 'react';
|
|
import { Organization } from '@/types';
|
|
import Badge from '@/components/ui/Badge';
|
|
import { LogIn, LogOut } from 'lucide-react';
|
|
|
|
interface Match {
|
|
partner: Organization;
|
|
resource: string;
|
|
}
|
|
|
|
interface MatchCardProps {
|
|
match: Match;
|
|
onSelectOrg: (org: Organization) => void;
|
|
type: 'provider' | 'consumer';
|
|
}
|
|
|
|
const MatchCard: React.FC<MatchCardProps> = ({ match, onSelectOrg, type }) => {
|
|
const icon =
|
|
type === 'provider' ? (
|
|
<LogOut className="h-4 h-5 text-current text-success w-4 w-5" />
|
|
) : (
|
|
<LogIn className="h-4 h-5 text-current text-destructive w-4 w-5" />
|
|
);
|
|
|
|
const handleSelect = useCallback(() => {
|
|
onSelectOrg(match.partner);
|
|
}, [onSelectOrg, match.partner]);
|
|
|
|
return (
|
|
<div className="p-3 bg-muted/50 rounded-lg flex items-center gap-3 transition-colors hover:bg-muted">
|
|
<div className="shrink-0">{icon}</div>
|
|
<div className="flex-1 min-w-0">
|
|
<Badge
|
|
variant="outline"
|
|
className={`capitalize ${type === 'provider' ? 'bg-success/10 text-success border-success/20' : 'bg-destructive/10 text-destructive border-destructive/20'}`}
|
|
>
|
|
{match.resource}
|
|
</Badge>
|
|
<button
|
|
onClick={handleSelect}
|
|
className="block font-medium text-left text-base text-foreground hover:text-primary hover:underline mt-1 w-full truncate"
|
|
>
|
|
{match.partner.name}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default React.memo(MatchCard);
|