Build Nuxt 4 manager cabinet workflows
This commit is contained in:
19
app/components/orders/OrderStatusBadge.stories.ts
Normal file
19
app/components/orders/OrderStatusBadge.stories.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import type { Meta, StoryObj } from '@storybook/vue3-vite';
|
||||
import OrderStatusBadge from './OrderStatusBadge.vue';
|
||||
|
||||
const meta: Meta<typeof OrderStatusBadge> = {
|
||||
title: 'Orders/OrderStatusBadge',
|
||||
component: OrderStatusBadge,
|
||||
};
|
||||
|
||||
export default meta;
|
||||
|
||||
type Story = StoryObj<typeof OrderStatusBadge>;
|
||||
|
||||
export const InProgress: Story = {
|
||||
args: { status: 'IN_PROGRESS' },
|
||||
};
|
||||
|
||||
export const Completed: Story = {
|
||||
args: { status: 'COMPLETED' },
|
||||
};
|
||||
16
app/components/orders/OrderStatusBadge.vue
Normal file
16
app/components/orders/OrderStatusBadge.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
const props = defineProps<{
|
||||
status: string;
|
||||
}>();
|
||||
|
||||
const className = computed(() => {
|
||||
if (props.status === 'COMPLETED') return 'badge badge-success';
|
||||
if (props.status === 'CLIENT_REJECTED' || props.status === 'MANAGER_REJECTED') return 'badge badge-error';
|
||||
if (props.status === 'MANAGER_BLOCKED') return 'badge badge-warning';
|
||||
return 'badge badge-info';
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span :class="className">{{ status }}</span>
|
||||
</template>
|
||||
Reference in New Issue
Block a user