@@ -35,11 +35,7 @@ import { styleClass } from './utils';
3535import { Image } from ' ../Image' ;
3636import type { Size } from ' ./utils' ;
3737
38- enum Status {
39- Pending = ' PENDING' ,
40- Loaded = ' LOADED' ,
41- Errored = ' ERRORED' ,
42- }
38+ type Status = ' PENDING' | ' LOADED' | ' ERRORED' ;
4339
4440interface Props {
4541 /**
@@ -70,15 +66,15 @@ const props = withDefaults(defineProps<Props>(),{
7066
7167const emit = defineEmits <{ (event : ' error' ): void }>();
7268
73- const status = ref <Status >(Status . Pending );
69+ const status = ref <Status >(' PENDING ' );
7470
7571const svgPath = ' M8.28 27.5A14.95 14.95 0 0120 21.8c4.76 0 8.97 2.24 11.72 5.7a14.02 14.02 0 01-8.25 5.91 14.82 14.82 0 01-6.94 0 14.02 14.02 0 01-8.25-5.9zM13.99 12.78a6.02 6.02 0 1112.03 0 6.02 6.02 0 01-12.03 0z' ;
7672
7773// Use `dominant-baseline: central` instead of `dy` when Edge supports it.
7874const verticalOffset = ' 0.35em' ;
7975
8076const hasImage = computed (() => {
81- return props .source && status .value !== Status . Errored ;
77+ return props .source && status .value !== ' ERRORED ' ;
8278});
8379
8480const className = computed (() => {
@@ -90,7 +86,7 @@ const className = computed(() => {
9086 size && styles [size ],
9187 ! props .customer && styles [style ],
9288 (hasImage .value || (props .initials && props .initials .length === 0 ))
93- && status .value !== Status . Loaded
89+ && status .value !== ' LOADED '
9490 && styles .hidden ,
9591 hasImage .value && styles .hasImage ,
9692 );
@@ -107,11 +103,11 @@ const label = computed(() => {
107103});
108104
109105const handleLoad = () => {
110- status .value = Status . Loaded ;
106+ status .value = ' LOADED ' ;
111107}
112108
113109const handleError = () => {
114- status .value = Status . Errored ;
110+ status .value = ' ERRORED ' ;
115111 emit (' error' );
116112}
117113 </script >
0 commit comments