66 lines
1.3 KiB
Plaintext
66 lines
1.3 KiB
Plaintext
<template>
|
|
<view
|
|
class="workflow-chip"
|
|
:class="{ 'workflow-chip--active': active }"
|
|
:style="active ? { background: workflow.color, boxShadow: `0 4rpx 16rpx ${workflow.color}44` } : {}"
|
|
@tap="onTap"
|
|
>
|
|
<text class="workflow-chip__icon">{{ workflow.icon }}</text>
|
|
<text class="workflow-chip__label" :class="{ 'workflow-chip__label--active': active }">{{ workflow.name }}</text>
|
|
</view>
|
|
</template>
|
|
|
|
<script setup lang="uts">
|
|
import type { WorkflowDef } from '@/types/index'
|
|
|
|
const props = defineProps<{
|
|
workflow: WorkflowDef
|
|
active: boolean
|
|
}>()
|
|
|
|
const emit = defineEmits<{
|
|
tap: []
|
|
}>()
|
|
|
|
function onTap(): void {
|
|
emit('tap')
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.workflow-chip {
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
height: 64rpx;
|
|
padding: 0 24rpx;
|
|
border-radius: 32rpx;
|
|
background: rgba(255, 255, 255, 0.06);
|
|
margin-right: 16rpx;
|
|
flex-shrink: 0;
|
|
transition: all 0.25s ease;
|
|
border: 1px solid rgba(255, 255, 255, 0.06);
|
|
}
|
|
|
|
.workflow-chip--active {
|
|
border-color: transparent;
|
|
}
|
|
|
|
.workflow-chip__icon {
|
|
font-size: 28rpx;
|
|
margin-right: 8rpx;
|
|
}
|
|
|
|
.workflow-chip__label {
|
|
font-size: 26rpx;
|
|
color: rgba(255, 255, 255, 0.55);
|
|
white-space: nowrap;
|
|
transition: color 0.25s ease;
|
|
}
|
|
|
|
.workflow-chip__label--active {
|
|
color: #ffffff;
|
|
font-weight: 600;
|
|
}
|
|
</style>
|