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 (
);
}
);
SimilarOrgItem.displayName = 'SimilarOrgItem';
const SimilarOrganizations = ({
organizations,
onSelectOrg,
}: {
organizations: Organization[];
onSelectOrg: (org: Organization) => void;
}) => {
const { t } = useTranslation();
if (!organizations || organizations.length === 0) return null;
return (
{t('similarOrganizations.title')}
{organizations.map((org) => (
))}
);
};
export default React.memo(SimilarOrganizations);