diff --git a/packages/napcat-webui-frontend/src/components/display_card/container.tsx b/packages/napcat-webui-frontend/src/components/display_card/container.tsx index 790d09b9..99d66630 100644 --- a/packages/napcat-webui-frontend/src/components/display_card/container.tsx +++ b/packages/napcat-webui-frontend/src/components/display_card/container.tsx @@ -4,7 +4,7 @@ import clsx from 'clsx'; import key from '@/const/key'; export interface ContainerProps { - title: string; + title: React.ReactNode; tag?: React.ReactNode; action: React.ReactNode; enableSwitch: React.ReactNode; @@ -22,6 +22,7 @@ export interface DisplayCardProps { const DisplayCardContainer: React.FC = ({ title: _title, + tag, action, enableSwitch, children, @@ -39,13 +40,15 @@ const DisplayCardContainer: React.FC = ({ >
-
- + {/* 限制标题区域最大宽度并隐藏溢出,确保 long title 能正确截断显示省略号 */} +
+ {_title}
-
{enableSwitch}
+ {tag &&
{tag}
} + {enableSwitch &&
{enableSwitch}
} {children} {action} diff --git a/packages/napcat-webui-frontend/src/components/display_card/plugin_card.tsx b/packages/napcat-webui-frontend/src/components/display_card/plugin_card.tsx index e79ab221..d884dc92 100644 --- a/packages/napcat-webui-frontend/src/components/display_card/plugin_card.tsx +++ b/packages/napcat-webui-frontend/src/components/display_card/plugin_card.tsx @@ -1,6 +1,7 @@ import { Button } from '@heroui/button'; import { Switch } from '@heroui/switch'; import { Chip } from '@heroui/chip'; +import { Tooltip } from '@heroui/tooltip'; import { useState } from 'react'; import { MdDeleteForever, MdSettings } from 'react-icons/md'; @@ -41,28 +42,27 @@ const PluginDisplayCard: React.FC = ({ -
+
+ -
+ {hasConfig && (
+ } tag={
{installStatus === 'installed' && ( @@ -65,7 +84,8 @@ const PluginStoreCard: React.FC = ({ color="success" size="sm" variant="flat" - startContent={} + className="h-6 text-[10px] bg-success-50 dark:bg-success-500/10 text-success-600" + startContent={} > 已安装 @@ -75,17 +95,11 @@ const PluginStoreCard: React.FC = ({ color="warning" size="sm" variant="flat" + className="h-6 text-[10px] bg-warning-50 dark:bg-warning-500/10 text-warning-600" > 可更新 )} - - v{version} -
} enableSwitch={undefined} @@ -104,51 +118,48 @@ const PluginStoreCard: React.FC = ({ } > -
-
- - 作者 +
+ {/* 作者和包名 */} +
+ + 作者: {author || '未知'} -
- {author || '未知'} -
+ / + + {displayId} +
-
- - 版本 - -
- v{version} -
-
-
- - 描述 - -
- {description || '暂无描述'} -
-
- {id && ( -
- - 包名 - -
- {id || '包名'} + + {/* 描述 */} + +
+
+ {description || '暂无描述'}
- )} - {tags && tags.length > 0 && ( -
- - 标签 - -
- {tags.slice(0, 2).join(' · ')} -
-
- )} +
+ + {/* 标签栏 - 优化后的极简风格 */} +
+ {tags && tags.length > 0 ? ( + tags.map((tag, index) => ( +
+ + {tag} +
+ )) + ) : ( + no tags + )} +
);