feat(lite/component): UI Icon utility component (#6353)

This commit is contained in:
Thierry Goettelmann 2022-08-10 08:37:26 +02:00 committed by Julien Fontanet
parent 0effc9cfc1
commit d91f1841c0

View File

@ -0,0 +1,28 @@
<template>
<FontAwesomeIcon
v-if="icon !== undefined"
:icon="icon"
:spin="busy"
class="ui-icon"
:fixed-width="fixedWidth"
/>
</template>
<script lang="ts" setup>
import { computed } from "vue";
import type { IconDefinition } from "@fortawesome/fontawesome-common-types";
import { faSpinner } from "@fortawesome/pro-solid-svg-icons";
const props = withDefaults(
defineProps<{
busy?: boolean;
icon?: IconDefinition;
fixedWidth?: boolean;
}>(),
{ fixedWidth: true }
);
const icon = computed(() => (props.busy ? faSpinner : props.icon));
</script>
<style lang="postcss" scoped></style>