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.
52 lines
1.0 KiB
52 lines
1.0 KiB
<template>
|
|
<i
|
|
:class="iconClass"
|
|
aria-hidden="true"
|
|
@click="$emit('click', $event)"
|
|
class="cursor-pointer"
|
|
/>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { computed } from "vue"
|
|
import { chamiloIconToClass } from "./ChamiloIcons"
|
|
|
|
const props = defineProps({
|
|
icon: {
|
|
type: String,
|
|
required: true,
|
|
validator: (value) => {
|
|
if (typeof value !== "string") {
|
|
return false
|
|
}
|
|
return Object.keys(chamiloIconToClass).includes(value)
|
|
},
|
|
},
|
|
size: {
|
|
type: String,
|
|
default: "normal",
|
|
validator: (value) => {
|
|
if (typeof value !== "string") {
|
|
return false
|
|
}
|
|
return ["big", "normal", "small"].includes(value)
|
|
},
|
|
},
|
|
})
|
|
|
|
const iconClass = computed(() => {
|
|
let iconClass = chamiloIconToClass[props.icon] + " "
|
|
switch (props.size) {
|
|
case "big":
|
|
iconClass += "text-3xl/4 "
|
|
break
|
|
case "normal":
|
|
iconClass += "text-xl/4 "
|
|
break
|
|
case "small":
|
|
iconClass += "text-base/4 "
|
|
break
|
|
}
|
|
return iconClass
|
|
})
|
|
</script>
|
|
|