diff --git a/frontend-temp/src/pages/pc/admin/schedules/ScheduleCategory.jsx b/frontend-temp/src/pages/pc/admin/schedules/ScheduleCategory.jsx index adb005d..fb666f2 100644 --- a/frontend-temp/src/pages/pc/admin/schedules/ScheduleCategory.jsx +++ b/frontend-temp/src/pages/pc/admin/schedules/ScheduleCategory.jsx @@ -8,32 +8,7 @@ import { AdminLayout, ConfirmDialog } from '@/components/pc/admin'; import { useAdminAuth } from '@/hooks/pc/admin'; import { useToast } from '@/hooks/common'; import * as categoriesApi from '@/api/admin/categories'; - -// 기본 색상 (8개) -const colorOptions = [ - { id: 'blue', name: '파란색', bg: 'bg-blue-500', hex: '#3b82f6' }, - { id: 'green', name: '초록색', bg: 'bg-green-500', hex: '#22c55e' }, - { id: 'purple', name: '보라색', bg: 'bg-purple-500', hex: '#a855f7' }, - { id: 'red', name: '빨간색', bg: 'bg-red-500', hex: '#ef4444' }, - { id: 'pink', name: '분홍색', bg: 'bg-pink-500', hex: '#ec4899' }, - { id: 'yellow', name: '노란색', bg: 'bg-yellow-500', hex: '#eab308' }, - { id: 'orange', name: '주황색', bg: 'bg-orange-500', hex: '#f97316' }, - { id: 'gray', name: '회색', bg: 'bg-gray-500', hex: '#6b7280' }, -]; - -// 색상 헬퍼 (커스텀 HEX 지원) -const getColorStyle = (colorValue) => { - // 기본 색상인지 확인 - const preset = colorOptions.find((c) => c.id === colorValue); - if (preset) { - return { className: preset.bg }; - } - // HEX 색상인 경우 - if (colorValue?.startsWith('#')) { - return { style: { backgroundColor: colorValue } }; - } - return { className: 'bg-gray-500' }; -}; +import { COLOR_OPTIONS, getColorStyle } from '@/utils/color'; function ScheduleCategory() { const { user, isAuthenticated } = useAdminAuth(); @@ -319,7 +294,7 @@ function ScheduleCategory() {
- {colorOptions.map((color) => ( + {COLOR_OPTIONS.map((color) => (