diff --git a/frontend/src/components/TagsSelect.vue b/frontend/src/components/TagsSelect.vue index 402b084..996c2c3 100644 --- a/frontend/src/components/TagsSelect.vue +++ b/frontend/src/components/TagsSelect.vue @@ -8,12 +8,14 @@ export type TagsSelectOption = { id: number | string; name: string; label?: string; + thumbnailUrl?: string | null; }; type OptionRow = { value: string; label: string; id: string; + thumbnailUrl: string | null; }; type CandidateRow = { type: 'option'; id: string; value: string; label: string } | { type: 'create'; id: string }; @@ -65,7 +67,8 @@ const optionRows = computed(() => props.options.map((option, index) => ({ value: String(option.id), label: option.label ?? option.name, - id: `${props.id}-option-${index}` + id: `${props.id}-option-${index}`, + thumbnailUrl: option.thumbnailUrl ?? null })) ); @@ -79,9 +82,10 @@ const maxReached = computed(() => props.multiple && props.max > 0 && modelValues const selectedRows = computed(() => modelValues.value .map((value) => optionRows.value.find((option) => option.value === value)) - .filter((option) => option !== undefined) + .filter((option): option is OptionRow => option !== undefined) ); const selectedLabel = computed(() => selectedRows.value[0]?.label ?? ''); +const selectedThumbnailUrl = computed(() => selectedRows.value[0]?.thumbnailUrl ?? ''); const filteredRows = computed(() => { const keyword = search.value.trim().toLowerCase(); @@ -360,6 +364,7 @@ watch( - {{ selectedLabel }} + + + {{ selectedLabel }} + {{ placeholderText }}