diff --git a/web/src/components/children-delimiter-form.tsx b/web/src/components/children-delimiter-form.tsx index b39d243c1..678be44e1 100644 --- a/web/src/components/children-delimiter-form.tsx +++ b/web/src/components/children-delimiter-form.tsx @@ -18,7 +18,10 @@ interface IProps { } export const DelimiterInput = forwardRef( - ({ value, onChange, maxLength, defaultValue, ...props }, ref) => { + function DelimiterInput( + { value, onChange, maxLength, defaultValue, ...props }, + ref, + ) { const nextValue = value ?.replaceAll('\n', '\\n') .replaceAll('\t', '\\t') diff --git a/web/src/components/delimiter-form-field.tsx b/web/src/components/delimiter-form-field.tsx index 77fded5a3..40f97a2c8 100644 --- a/web/src/components/delimiter-form-field.tsx +++ b/web/src/components/delimiter-form-field.tsx @@ -17,7 +17,10 @@ interface IProps { } export const DelimiterInput = forwardRef( - ({ value, onChange, maxLength, defaultValue, ...props }, ref) => { + function DelimiterInput( + { value, onChange, maxLength, defaultValue, ...props }, + ref, + ) { const nextValue = value ?.replaceAll('\n', '\\n') .replaceAll('\t', '\\t') diff --git a/web/src/components/document-preview/document-header.tsx b/web/src/components/document-preview/document-header.tsx index d5d47d72b..aadac8c7e 100644 --- a/web/src/components/document-preview/document-header.tsx +++ b/web/src/components/document-preview/document-header.tsx @@ -9,7 +9,12 @@ type Props = { className?: string; }; -export default ({ size, name, create_date, className }: Props) => { +export default function DocumentHeader({ + size, + name, + create_date, + className, +}: Props) { const sizeName = formatBytes(size); const dateStr = formatDate(create_date); @@ -32,4 +37,4 @@ export default ({ size, name, create_date, className }: Props) => { ); -}; +} diff --git a/web/src/components/theme-switch.tsx b/web/src/components/theme-switch.tsx index 1f4dde3e9..3143c8463 100644 --- a/web/src/components/theme-switch.tsx +++ b/web/src/components/theme-switch.tsx @@ -8,7 +8,7 @@ import { forwardRef } from 'react'; const ThemeSwitch = forwardRef< React.ElementRef, React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => { +>(function ThemeSwitch({ className, ...props }, ref) { const { setTheme } = useTheme(); const isDark = useIsDarkTheme(); diff --git a/web/src/components/ui/dual-range-slider.tsx b/web/src/components/ui/dual-range-slider.tsx index d8a581587..221d34d02 100644 --- a/web/src/components/ui/dual-range-slider.tsx +++ b/web/src/components/ui/dual-range-slider.tsx @@ -80,4 +80,6 @@ const SingleFormSlider = React.forwardRef< ); }); +SingleFormSlider.displayName = 'SingleFormSlider'; + export { DualRangeSlider, SingleFormSlider }; diff --git a/web/src/components/ui/textarea.tsx b/web/src/components/ui/textarea.tsx index 08fd8a6ed..03ac2f9a9 100644 --- a/web/src/components/ui/textarea.tsx +++ b/web/src/components/ui/textarea.tsx @@ -10,8 +10,10 @@ import { useRef, useState, } from 'react'; -interface TextareaProps - extends Omit, 'autoSize'> { +interface TextareaProps extends Omit< + TextareaHTMLAttributes, + 'autoSize' +> { autoSize?: { minRows?: number; maxRows?: number; @@ -95,9 +97,10 @@ const Textarea = forwardRef( )} rows={autoSize?.minRows ?? props.rows ?? undefined} style={{ - maxHeight: autoSize?.maxRows && !resizable - ? `${autoSize.maxRows * 20}px` - : undefined, + maxHeight: + autoSize?.maxRows && !resizable + ? `${autoSize.maxRows * 20}px` + : undefined, resize, }} ref={textareaRef} @@ -118,7 +121,7 @@ export const BlurTextarea = forwardRef< value: Value; onChange(value: Value): void; } ->(({ value, onChange, ...props }, ref) => { +>(function BlurTextarea({ value, onChange, ...props }, ref) { const [val, setVal] = useState(); const handleChange: ChangeEventHandler = useCallback( diff --git a/web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/chunk-result-bar/checkbox-sets.tsx b/web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/chunk-result-bar/checkbox-sets.tsx index 77169cea4..e31d22473 100644 --- a/web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/chunk-result-bar/checkbox-sets.tsx +++ b/web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/chunk-result-bar/checkbox-sets.tsx @@ -18,7 +18,7 @@ type ICheckboxSetProps = { checked: boolean; selectedChunkIds: string[]; }; -export default (props: ICheckboxSetProps) => { +export default function CheckboxSets(props: ICheckboxSetProps) { const { className, selectAllChunk, @@ -79,4 +79,4 @@ export default (props: ICheckboxSetProps) => { )} ); -}; +} diff --git a/web/src/pages/dataflow-result/components/chunk-result-bar/checkbox-sets.tsx b/web/src/pages/dataflow-result/components/chunk-result-bar/checkbox-sets.tsx index bf98299a2..7b4f571c8 100644 --- a/web/src/pages/dataflow-result/components/chunk-result-bar/checkbox-sets.tsx +++ b/web/src/pages/dataflow-result/components/chunk-result-bar/checkbox-sets.tsx @@ -10,7 +10,7 @@ type ICheckboxSetProps = { checked: boolean; selectedChunkIds: string[]; }; -export default (props: ICheckboxSetProps) => { +export default function CheckboxSets(props: ICheckboxSetProps) { const { selectAllChunk, removeChunk, checked, selectedChunkIds } = props; const { t } = useTranslation(); const handleSelectAllCheck = useCallback( @@ -53,4 +53,4 @@ export default (props: ICheckboxSetProps) => { )} ); -}; +} diff --git a/web/src/pages/dataflow-result/components/chunk-result-bar/index.tsx b/web/src/pages/dataflow-result/components/chunk-result-bar/index.tsx index 5839f2116..48540cfe1 100644 --- a/web/src/pages/dataflow-result/components/chunk-result-bar/index.tsx +++ b/web/src/pages/dataflow-result/components/chunk-result-bar/index.tsx @@ -9,11 +9,11 @@ interface ChunkResultBarProps { createChunk: (text: string) => void; isReadonly: boolean; } -export default ({ +export default function ChunkResultBar({ changeChunkTextMode, createChunk, isReadonly, -}: ChunkResultBarProps) => { +}: ChunkResultBarProps) { const { t } = useTranslate('chunk'); const [textSelectValue, setTextSelectValue] = useState( ChunkTextMode.Full, @@ -57,4 +57,4 @@ export default ({ )} ); -}; +} diff --git a/web/src/pages/memories/add-or-edit-modal.tsx b/web/src/pages/memories/add-or-edit-modal.tsx index 238425608..859a8518e 100644 --- a/web/src/pages/memories/add-or-edit-modal.tsx +++ b/web/src/pages/memories/add-or-edit-modal.tsx @@ -14,7 +14,7 @@ type IProps = { loading?: boolean; isCreate?: boolean; }; -export const AddOrEditModal = memo((props: IProps) => { +export const AddOrEditModal = memo(function AddOrEditModal(props: IProps) { const { open, onClose, onSubmit, initialMemory, isCreate } = props; const { t } = useTranslation(); // const { modelOptions } = useModelOptions();