<script setup lang="ts">
import type { IconType } from "@/shared/ui/icon/types"
interface Props {
type: IconType
size: number
}
const { type, size } = defineProps<Props>()
</script>
<template>
<svg v-else-if="type === 'star'" xmlns="http://www.w3.org/2000/svg" :width="size" :height="size" viewBox="0 0 24 24"
fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="lucide lucide-star">
<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" />
</svg>
</template>
<script setup lang="ts">
import { computed } from "vue"
import { Typography } from "@/shared/ui/typography"
interface Props {
color: "primary" | "secondary" | "tertiary" | "danger" | "only" // TODO: над only подумать
state: "default" | "loading"
size: "L" | "M" | "S"
disabled?: boolean
}
const props = defineProps<Props>()
const btnClasses = computed(() => [
`button`,
`color_${props.color}`
])
const divClasses = computed(() => [
`size_${props.size}`
])
</script>
<template>
<button :class="btnClasses" :disabled="props.disabled">
<div :class="['flex', 'justify-center', 'items-center', ...divClasses, { 'opacity-50': props.disabled }]">
<slot name="leftIcon"></slot>
<Typography v-if="size === 'L'" class="text-center font-semibold px-1" tagName="span" size="xl">
<slot></slot>
</Typography>
<Typography v-else-if="size === 'M'" class="text-center font-semibold px-1" tagName="span" size="l">
<slot></slot>
</Typography>
<slot name="rightIcon"></slot>
</div>
</button>
</template>
.button {
svg, path {
&:hover {
fill: #000;
stroke: #000;
}
}
}