show topic description tooltip in interesting-for card
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/head This commit looks good
This commit is contained in:
@@ -8,7 +8,9 @@
|
||||
<div class="interest-tags">
|
||||
@if (tags().length > 0) {
|
||||
@for (tag of tags(); track tag.label) {
|
||||
<button type="button" class="interest-tag-button">{{ tag.label }} ({{ tag.count }}*)</button>
|
||||
<button type="button" class="interest-tag-button" [matTooltip]="tag.description">
|
||||
{{ tag.label }} ({{ tag.count }}*)
|
||||
</button>
|
||||
}
|
||||
} @else {
|
||||
<span class="interest-empty">Keine Themen gefunden</span>
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
import { Component, input, computed } from '@angular/core';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
|
||||
import { TopicCount } from '../../api';
|
||||
|
||||
interface InterestTag {
|
||||
label: string;
|
||||
count: number;
|
||||
description: string;
|
||||
}
|
||||
|
||||
const MAX_TAGS = 5;
|
||||
|
||||
@Component({
|
||||
selector: 'app-person-interesting',
|
||||
imports: [],
|
||||
imports: [MatTooltipModule],
|
||||
templateUrl: './person-interesting.component.html',
|
||||
styleUrl: './person-interesting.component.scss',
|
||||
})
|
||||
@@ -26,7 +28,11 @@ export class PersonInterestingComponent {
|
||||
const label = (topic.name ?? '').trim();
|
||||
if (!label) continue;
|
||||
|
||||
tags.push({ label, count: topic.count ?? 0 });
|
||||
tags.push({
|
||||
label,
|
||||
count: topic.count ?? 0,
|
||||
description: (topic.description ?? '').trim(),
|
||||
});
|
||||
}
|
||||
|
||||
return tags.sort((a, b) => b.count - a.count).slice(0, MAX_TAGS);
|
||||
|
||||
Reference in New Issue
Block a user