use country-flag component in EU-Cordis organizations table

This commit is contained in:
2026-08-03 21:20:32 +02:00
parent bee09f7c29
commit 876fbb9980
2 changed files with 6 additions and 22 deletions
@@ -33,15 +33,11 @@
{{ org.city }}
@if (org.country) {
<img
alt=""
<app-country-flag
class="country-flag"
[src]="
'https://flagcdn.io/' +
getSvgByCountryCode(org.country) +
'.svg'
"
height="10" />
[countryCode]="org.country"
[height]="10"
[bordered]="false" />
}
</span>
} @else {
@@ -19,6 +19,7 @@ import {
DataTableComponent,
GenericColumn,
} from '../../../../shared/ui/data-table/data-table.component';
import { CountryFlagComponent } from '../../../../shared/ui/country-flag/country-flag.component';
@Component({
selector: 'app-organizations-table',
@@ -29,6 +30,7 @@ import {
CurrencyPipe,
DataTableComponent,
MatPaginatorModule,
CountryFlagComponent,
],
templateUrl: './organizations-table.component.html',
styleUrl: './organizations-table.component.scss',
@@ -128,20 +130,6 @@ export class OrganizationsTableComponent {
this.pageSize.set(event.pageSize);
}
getSvgByCountryCode(code: string | undefined | null): string {
if (!code) {
return '';
}
const codeLower = code.toLowerCase();
if (codeLower === 'uk') {
return 'gb';
}
return codeLower;
}
getOrgsCount(): number {
return this.orgs?.length || 0;
}