Files
gridpilot.gg/apps/website/lib/view-models/SponsorViewModel.ts
2025-12-17 18:01:47 +01:00

27 lines
541 B
TypeScript

import { SponsorDto } from '../dtos';
export class SponsorViewModel implements SponsorDto {
id: string;
name: string;
logoUrl?: string;
websiteUrl?: string;
constructor(dto: SponsorDto) {
Object.assign(this, dto);
}
/** UI-specific: Display name */
get displayName(): string {
return this.name;
}
/** UI-specific: Whether has website */
get hasWebsite(): boolean {
return !!this.websiteUrl;
}
/** UI-specific: Website link text */
get websiteLinkText(): string {
return 'Visit Website';
}
}