From 25417aacf9720598251c2be1b0e57314b711620b Mon Sep 17 00:00:00 2001 From: canisminor1990 Date: Tue, 24 Dec 2024 15:34:52 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style:=20Add=20shape=20to=20Mode?= =?UTF-8?q?lIcon=20and=20ProviderIcon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/ModelIcon/index.tsx | 7 ++++--- src/features/ProviderIcon/index.tsx | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/features/ModelIcon/index.tsx b/src/features/ModelIcon/index.tsx index a6a87099..d99a101b 100644 --- a/src/features/ModelIcon/index.tsx +++ b/src/features/ModelIcon/index.tsx @@ -9,13 +9,14 @@ import DefaultIcon from './DefaultIcon'; export interface ModelIconProps { className?: string; model?: string; + shape?: 'circle' | 'square'; size?: number; style?: CSSProperties; type?: 'avatar' | 'mono' | 'color' | 'combine' | 'combine-color'; } const ModelIcon = forwardRef( - ({ model: originModel, size = 12, type = 'avatar', ...rest }, ref) => { + ({ model: originModel, size = 12, type = 'avatar', shape, ...rest }, ref) => { const Render = useMemo(() => { if (!originModel) return; const model = originModel.toLowerCase(); @@ -35,8 +36,8 @@ const ModelIcon = forwardRef( switch (type) { case 'avatar': { - if (!Render?.Icon) return ; - return ; + if (!Render?.Icon) return ; + return ; } case 'mono': { if (!Render?.Icon) return ; diff --git a/src/features/ProviderIcon/index.tsx b/src/features/ProviderIcon/index.tsx index 4493fd07..ce6f3280 100644 --- a/src/features/ProviderIcon/index.tsx +++ b/src/features/ProviderIcon/index.tsx @@ -11,13 +11,14 @@ export interface ProviderIconProps { className?: string; forceMono?: boolean; provider?: ModelProviderKey | string; + shape?: 'circle' | 'square'; size?: number; style?: CSSProperties; type?: 'avatar' | 'mono' | 'color' | 'combine' | 'combine-color'; } const ProviderIcon = forwardRef( - ({ provider: originProvider, size = 12, type = 'avatar', forceMono, ...rest }, ref) => { + ({ provider: originProvider, size = 12, type = 'avatar', forceMono, shape, ...rest }, ref) => { const Render = useMemo(() => { if (!originProvider) return; const provider = originProvider.toLowerCase(); @@ -38,8 +39,8 @@ const ProviderIcon = forwardRef( switch (type) { case 'avatar': { - if (!Render?.Icon) return ; - return ; + if (!Render?.Icon) return ; + return ; } case 'mono': { if (!Render?.Icon) return ;