From 7f6c217d7e1dce3edc5d90385d456f4ff39f733c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Mon, 10 Feb 2025 22:00:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=89=B2=E5=8D=A1=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E5=8A=A0=E8=BD=BD=E8=89=B2=E5=8D=A1=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E7=A7=8D=E7=B1=BB=E7=9A=84=E5=A4=84=E7=90=86=E8=BF=87=E7=A8=8B?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/CardsDetail.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/CardsDetail.tsx b/src/pages/CardsDetail.tsx index d09a475..90c239f 100644 --- a/src/pages/CardsDetail.tsx +++ b/src/pages/CardsDetail.tsx @@ -6,6 +6,7 @@ import { HSegmentedControl } from '../components/HSegmentedControl'; import { ScrollArea } from '../components/ScrollArea'; import { ColorDescription } from '../models'; import { ColorCard } from '../page-components/cards-detail/ColorCard'; +import { mapToObject } from '../utls'; import styles from './CardsDetail.module.css'; type ColorModes = 'hex' | 'rgb' | 'hsl' | 'lab' | 'oklch'; @@ -20,7 +21,11 @@ export function CardsDetail({ mainTag }: CardsDetailProps) { return []; } try { - const embededCategories = colorFn.color_categories() as { label: string; value: string }[]; + const embededCategories = colorFn.color_categories().map(mapToObject) as { + label: string; + value: string; + }[]; + console.debug('[Fetch color categories]', embededCategories); return embededCategories.filter((cate) => !isEqual(cate.value, 'unknown')); } catch (e) { console.error('[Fetch color categories]', e);