Skip to content

Commit adc6474

Browse files
committed
feat: add cover image fields to Taxon model for the UI
1 parent cccbe9e commit adc6474

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

ui/src/data-services/models/species.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,23 @@ export class Species extends Taxon {
3737
return `https://www.gbif.org/occurrence/gallery?advanced=1&verbatim_scientific_name=${this.name}`
3838
}
3939

40+
get fieldguideId(): string | null {
41+
return this._species.fieldguide_id || null
42+
}
43+
44+
get fieldguideUrl(): string | undefined {
45+
if (!this.fieldguideId) return undefined
46+
return `https://leps.fieldguide.ai/categories?category=${this.fieldguideId}`
47+
}
48+
49+
get coverImageUrl(): string | null {
50+
return this._species.cover_image_url || null
51+
}
52+
53+
get coverImageCredit(): string | null {
54+
return this._species.cover_image_credit || null
55+
}
56+
4057
get score(): number {
4158
return this._species.best_determination_score || 0
4259
}

0 commit comments

Comments
 (0)