Files
Liang XJ 092fb2e083
Some checks failed
Lock Threads / action (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot EE docker images / merge (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot CE docker images / merge (push) Has been cancelled
Run Chatwoot CE spec / lint-backend (push) Has been cancelled
Run Chatwoot CE spec / lint-frontend (push) Has been cancelled
Run Chatwoot CE spec / frontend-tests (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (0, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (1, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (10, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (11, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (12, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (13, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (14, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (15, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (2, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (3, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (4, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (5, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (6, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (7, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (8, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (9, 16) (push) Has been cancelled
Run Linux nightly installer / nightly (push) Has been cancelled
Initial commit: Add logistics and order_detail message types
- Add Logistics component with progress tracking
- Add OrderDetail component for order information
- Support data-driven steps and actions
- Add blue color scale to widget SCSS
- Fix node overflow and progress bar rendering issues
- Add English translations for dashboard components

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-26 11:16:56 +08:00

94 lines
2.2 KiB
Vue

<script setup>
import { computed, ref } from 'vue';
import { useIntervalFn } from '@vueuse/core';
import { useI18n } from 'vue-i18n';
import { MESSAGE_STATUS } from './constants';
import Icon from 'next/icon/Icon.vue';
const { status } = defineProps({
status: {
type: String,
required: true,
validator: value => Object.values(MESSAGE_STATUS).includes(value),
},
});
const { t } = useI18n();
const progresIconSequence = [
'i-lucide-clock-1',
'i-lucide-clock-2',
'i-lucide-clock-3',
'i-lucide-clock-4',
'i-lucide-clock-5',
'i-lucide-clock-6',
'i-lucide-clock-7',
'i-lucide-clock-8',
'i-lucide-clock-9',
'i-lucide-clock-10',
'i-lucide-clock-11',
'i-lucide-clock-12',
];
const progessIcon = ref(progresIconSequence[0]);
const rotateIcon = () => {
const currentIndex = progresIconSequence.indexOf(progessIcon.value);
const nextIndex = (currentIndex + 1) % progresIconSequence.length;
progessIcon.value = progresIconSequence[nextIndex];
};
useIntervalFn(rotateIcon, 500, {
immediate: status === MESSAGE_STATUS.PROGRESS,
immediateCallback: false,
});
const statusIcon = computed(() => {
const statusIconMap = {
[MESSAGE_STATUS.SENT]: 'i-lucide-check',
[MESSAGE_STATUS.DELIVERED]: 'i-lucide-check-check',
[MESSAGE_STATUS.READ]: 'i-lucide-check-check',
};
return statusIconMap[status];
});
const statusColor = computed(() => {
const statusIconMap = {
[MESSAGE_STATUS.SENT]: 'text-n-slate-10',
[MESSAGE_STATUS.DELIVERED]: 'text-n-slate-10',
[MESSAGE_STATUS.READ]: 'text-[#7EB6FF]',
};
return statusIconMap[status];
});
const tooltipText = computed(() => {
const statusTextMap = {
[MESSAGE_STATUS.SENT]: t('CHAT_LIST.SENT'),
[MESSAGE_STATUS.DELIVERED]: t('CHAT_LIST.DELIVERED'),
[MESSAGE_STATUS.READ]: t('CHAT_LIST.MESSAGE_READ'),
[MESSAGE_STATUS.PROGRESS]: t('CHAT_LIST.SENDING'),
};
return statusTextMap[status];
});
</script>
<template>
<Icon
v-if="status === MESSAGE_STATUS.PROGRESS"
v-tooltip.top-start="tooltipText"
:icon="progessIcon"
class="text-n-slate-10"
/>
<Icon
v-else
v-tooltip.top-start="tooltipText"
:icon="statusIcon"
:class="statusColor"
class="size-[14px]"
/>
</template>