From a430284aa21e3ae1f0d5654e55b2ad2852519cc2 Mon Sep 17 00:00:00 2001
From: wwf <yearningwang@iqtogether.com>
Date: 星期三, 04 六月 2025 15:17:49 +0800
Subject: [PATCH] 初始化

---
 app/components/datasets/formatted-text/flavours/shared.tsx |   38 +++++++++-----------------------------
 1 files changed, 9 insertions(+), 29 deletions(-)

diff --git a/app/components/datasets/formatted-text/flavours/shared.tsx b/app/components/datasets/formatted-text/flavours/shared.tsx
index 1154857..577e3ce 100644
--- a/app/components/datasets/formatted-text/flavours/shared.tsx
+++ b/app/components/datasets/formatted-text/flavours/shared.tsx
@@ -1,32 +1,22 @@
-import type { ComponentProps, FC } from 'react'
+import { type ComponentProps, type FC, forwardRef } from 'react'
 import classNames from '@/utils/classnames'
 
 const baseStyle = 'py-[3px]'
 
 export type SliceContainerProps = ComponentProps<'span'>
 
-export const SliceContainer: FC<SliceContainerProps> = (
-  {
-    ref,
-    ...props
-  },
-) => {
+export const SliceContainer: FC<SliceContainerProps> = forwardRef((props, ref) => {
   const { className, ...rest } = props
   return <span {...rest} ref={ref} className={classNames(
     'group align-bottom mr-1 select-none text-sm',
     className,
   )} />
-}
+})
 SliceContainer.displayName = 'SliceContainer'
 
 export type SliceLabelProps = ComponentProps<'span'> & { labelInnerClassName?: string }
 
-export const SliceLabel: FC<SliceLabelProps> = (
-  {
-    ref,
-    ...props
-  },
-) => {
+export const SliceLabel: FC<SliceLabelProps> = forwardRef((props, ref) => {
   const { className, children, labelInnerClassName, ...rest } = props
   return <span {...rest} ref={ref} className={classNames(
     baseStyle,
@@ -37,17 +27,12 @@
       {children}
     </span>
   </span>
-}
+})
 SliceLabel.displayName = 'SliceLabel'
 
 export type SliceContentProps = ComponentProps<'span'>
 
-export const SliceContent: FC<SliceContentProps> = (
-  {
-    ref,
-    ...props
-  },
-) => {
+export const SliceContent: FC<SliceContentProps> = forwardRef((props, ref) => {
   const { className, children, ...rest } = props
   return <span {...rest} ref={ref} className={classNames(
     baseStyle,
@@ -56,17 +41,12 @@
   )}>
     {children}
   </span>
-}
+})
 SliceContent.displayName = 'SliceContent'
 
 export type SliceDividerProps = ComponentProps<'span'>
 
-export const SliceDivider: FC<SliceDividerProps> = (
-  {
-    ref,
-    ...props
-  },
-) => {
+export const SliceDivider: FC<SliceDividerProps> = forwardRef((props, ref) => {
   const { className, ...rest } = props
   return <span {...rest} ref={ref} className={classNames(
     baseStyle,
@@ -76,5 +56,5 @@
     {/* use a zero-width space to make the hover area bigger */}
     &#8203;
   </span>
-}
+})
 SliceDivider.displayName = 'SliceDivider'

--
Gitblit v1.8.0