[优化] 更新域名列表输入组件,优化按钮样式并支持自定义容器类型

This commit is contained in:
ryan
2026-04-01 09:34:17 +08:00
parent 77457250cf
commit a002d98f3a
4 changed files with 16 additions and 6 deletions
@@ -14,6 +14,7 @@ interface ResourceFieldProps {
error?: string;
className?: string;
tooltip?: string;
container?: 'label' | 'div';
children: ReactNode;
}
@@ -36,10 +37,13 @@ export function ResourceField({
error,
className,
tooltip,
container = 'label',
children,
}: ResourceFieldProps) {
const Container = container;
return (
<label className={cn('block space-y-2', className)}>
<Container className={cn('block space-y-2', className)}>
<span className="flex items-center gap-2 text-sm font-medium text-[var(--foreground-primary)]">
<span>{label}</span>
{tooltip ? <FieldTooltip content={tooltip} /> : null}
@@ -54,7 +58,7 @@ export function ResourceField({
{hint}
</span>
) : null}
</label>
</Container>
);
}