You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

31 lines
918 B

import { resolveFearAndGreedIndex } from '@ghostfolio/common/helper';
import { translate } from '@ghostfolio/ui/i18n';
import {
ChangeDetectionStrategy,
Component,
Input,
OnChanges
} from '@angular/core';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [NgxSkeletonLoaderModule],
selector: 'gf-fear-and-greed-index',
styleUrls: ['./fear-and-greed-index.component.scss'],
templateUrl: './fear-and-greed-index.component.html'
})
export class GfFearAndGreedIndexComponent implements OnChanges {
@Input() fearAndGreedIndex: number;
public fearAndGreedIndexEmoji: string;
public fearAndGreedIndexText: string;
public ngOnChanges() {
const { emoji, key } = resolveFearAndGreedIndex(this.fearAndGreedIndex);
this.fearAndGreedIndexEmoji = emoji;
this.fearAndGreedIndexText = translate(key);
}
}