From 77950e48c76f4a3b29d01831d43039caba29888a Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期二, 18 十一月 2025 14:12:42 +0800
Subject: [PATCH] 修改
---
app/components/datasets/create/step-two/option-card.tsx | 27 +++++++++++----------------
1 files changed, 11 insertions(+), 16 deletions(-)
diff --git a/app/components/datasets/create/step-two/option-card.tsx b/app/components/datasets/create/step-two/option-card.tsx
index 6bfe538..57ed50d 100644
--- a/app/components/datasets/create/step-two/option-card.tsx
+++ b/app/components/datasets/create/step-two/option-card.tsx
@@ -1,4 +1,4 @@
-import type { ComponentProps, FC, ReactNode } from 'react'
+import { type ComponentProps, type FC, type ReactNode, forwardRef } from 'react'
import Image from 'next/image'
import classNames from '@/utils/classnames'
@@ -25,20 +25,20 @@
isActive && activeClassName,
!disabled && 'cursor-pointer',
)}>
- <div className='relative flex size-14 items-center justify-center overflow-hidden'>
- {isActive && effectImg && <Image src={effectImg} className='absolute left-0 top-0 h-full w-full' alt='' width={56} height={56} />}
+ <div className='size-14 flex items-center justify-center relative overflow-hidden'>
+ {isActive && effectImg && <Image src={effectImg} className='absolute top-0 left-0 w-full h-full' alt='' width={56} height={56} />}
<div className='p-1'>
- <div className='flex size-8 justify-center rounded-lg border border-components-panel-border-subtle bg-background-default-dodge p-1.5 shadow-md'>
+ <div className='size-8 rounded-lg border p-1.5 shadow-md border-components-panel-border-subtle justify-center flex bg-background-default-dodge'>
{icon}
</div>
</div>
</div>
<TriangleArrow
- className={classNames('absolute left-4 -bottom-1.5 text-transparent', isActive && 'text-components-panel-bg')}
+ className='absolute left-4 -bottom-1.5 text-components-panel-bg'
/>
<div className='flex-1 space-y-0.5 py-3 pr-4'>
- <div className='system-md-semibold text-text-secondary'>{title}</div>
- <div className='system-xs-regular text-text-tertiary'>{description}</div>
+ <div className='text-text-secondary system-md-semibold'>{title}</div>
+ <div className='text-text-tertiary system-xs-regular'>{description}</div>
</div>
</div>
}
@@ -57,12 +57,7 @@
disabled?: boolean
} & Omit<ComponentProps<'div'>, 'title' | 'onClick'>
-export const OptionCard: FC<OptionCardProps> = (
- {
- ref,
- ...props
- },
-) => {
+export const OptionCard: FC<OptionCardProps> = forwardRef((props, ref) => {
const { icon, className, title, description, isActive, children, actions, activeHeaderClassName, style, effectImg, onSwitched, noHighlight, disabled, ...rest } = props
return <div
className={classNames(
@@ -93,14 +88,14 @@
disabled={disabled}
/>
{/** Body */}
- {isActive && (children || actions) && <div className='rounded-b-xl bg-components-panel-bg px-4 py-3'>
+ {isActive && (children || actions) && <div className='py-3 px-4 bg-components-panel-bg rounded-b-xl'>
{children}
- {actions && <div className='mt-4 flex gap-2'>
+ {actions && <div className='flex gap-2 mt-4'>
{actions}
</div>
}
</div>}
</div>
-}
+})
OptionCard.displayName = 'OptionCard'
--
Gitblit v1.8.0