turash/bugulma/frontend/components/organization/SimilarOrganizations.tsx
Damir Mukimov 6347f42e20
Consolidate repositories: Remove nested frontend .git and merge into main repository
- 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.
2025-11-25 06:02:57 +01:00

53 lines
1.6 KiB
TypeScript

import React, { useCallback } from 'react';
import { Organization } from '@/types.ts';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/Card.tsx';
import { useTranslation } from '@/hooks/useI18n.tsx';
const SimilarOrgItem = React.memo(
({ org, onSelectOrg }: { org: Organization; onSelectOrg: (org: Organization) => void }) => {
const handleSelect = useCallback(() => {
onSelectOrg(org);
}, [onSelectOrg, org]);
return (
<li>
<button
onClick={handleSelect}
className="text-left w-full p-3 rounded-lg bg-background hover:bg-muted transition-colors border hover:border-primary/20 hover:shadow-sm"
>
<p className="font-medium">{org.Name}</p>
<p className="text-sm text-muted-foreground line-clamp-2">{org.Description}</p>
</button>
</li>
);
}
);
SimilarOrgItem.displayName = 'SimilarOrgItem';
const SimilarOrganizations = ({
organizations,
onSelectOrg,
}: {
organizations: Organization[];
onSelectOrg: (org: Organization) => void;
}) => {
const { t } = useTranslation();
if (!organizations || organizations.length === 0) return null;
return (
<Card>
<CardHeader>
<CardTitle>{t('similarOrganizations.title')}</CardTitle>
</CardHeader>
<CardContent>
<ul className="space-y-3 -mt-4">
{organizations.map((org) => (
<SimilarOrgItem key={org.ID} org={org} onSelectOrg={onSelectOrg} />
))}
</ul>
</CardContent>
</Card>
);
};
export default React.memo(SimilarOrganizations);