review-state-label.component.ts 810 B

123456789101112131415161718192021222324252627
  1. import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
  2. import { SharedModule } from '@vendure/admin-ui/core';
  3. import { ReviewState } from '../../common/ui-types';
  4. @Component({
  5. selector: 'review-state-label',
  6. templateUrl: './review-state-label.component.html',
  7. styleUrls: ['./review-state-label.component.scss'],
  8. changeDetection: ChangeDetectionStrategy.OnPush,
  9. standalone: true,
  10. imports: [SharedModule],
  11. })
  12. export class ReviewStateLabelComponent {
  13. @Input() state: ReviewState;
  14. getIcon(state: ReviewState) {
  15. switch (state) {
  16. case 'new':
  17. return 'bubble-exclamation';
  18. case 'approved':
  19. return 'check-circle';
  20. case 'rejected':
  21. return 'times-circle';
  22. }
  23. }
  24. }