statuscomponent

This commit is contained in:
hamid zarghami
2025-11-15 12:41:49 +03:30
parent 59e2e62c56
commit f83a66f696
2 changed files with 35 additions and 7 deletions
@@ -2,6 +2,7 @@ import { Eye } from 'iconsax-react'
import type { ColumnType } from '@/components/types/TableTypes'
import type { Food } from '../types/Types'
import { formatPrice, formatTime } from '../utils/formatters'
import Status from '@/components/Status'
export const getFoodTableColumns = (): ColumnType<Food>[] => {
return [
@@ -55,13 +56,7 @@ export const getFoodTableColumns = (): ColumnType<Food>[] => {
title: 'وضعیت',
render: (item: Food) => {
return (
<div className={`h-6 w-fit flex items-center rounded-full px-2.5 text-xs ${
item.isActive
? 'bg-[#FFEDCA] text-[#FF7B00]'
: 'bg-gray-200 text-gray-600'
}`}>
{item.isActive ? 'فعال' : 'غیرفعال'}
</div>
<Status variant={item.isActive ? 'success' : 'error'} label={item.isActive ? 'فعال' : 'غیرفعال'} />
)
}
},