Fix: Component definition is missing display name. (#14255)

### What problem does this PR solve?

Fix: Component definition is missing display name.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2026-04-21 16:53:08 +08:00
committed by GitHub
parent e48d75987c
commit 4841ce4239
10 changed files with 35 additions and 19 deletions

View File

@@ -18,7 +18,10 @@ interface IProps {
}
export const DelimiterInput = forwardRef<HTMLInputElement, InputProps & IProps>(
({ value, onChange, maxLength, defaultValue, ...props }, ref) => {
function DelimiterInput(
{ value, onChange, maxLength, defaultValue, ...props },
ref,
) {
const nextValue = value
?.replaceAll('\n', '\\n')
.replaceAll('\t', '\\t')

View File

@@ -17,7 +17,10 @@ interface IProps {
}
export const DelimiterInput = forwardRef<HTMLInputElement, InputProps & IProps>(
({ value, onChange, maxLength, defaultValue, ...props }, ref) => {
function DelimiterInput(
{ value, onChange, maxLength, defaultValue, ...props },
ref,
) {
const nextValue = value
?.replaceAll('\n', '\\n')
.replaceAll('\t', '\\t')

View File

@@ -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) => {
</dl>
</header>
);
};
}

View File

@@ -8,7 +8,7 @@ import { forwardRef } from 'react';
const ThemeSwitch = forwardRef<
React.ElementRef<typeof Root>,
React.ComponentPropsWithoutRef<typeof Root>
>(({ className, ...props }, ref) => {
>(function ThemeSwitch({ className, ...props }, ref) {
const { setTheme } = useTheme();
const isDark = useIsDarkTheme();

View File

@@ -80,4 +80,6 @@ const SingleFormSlider = React.forwardRef<
);
});
SingleFormSlider.displayName = 'SingleFormSlider';
export { DualRangeSlider, SingleFormSlider };

View File

@@ -10,8 +10,10 @@ import {
useRef,
useState,
} from 'react';
interface TextareaProps
extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'autoSize'> {
interface TextareaProps extends Omit<
TextareaHTMLAttributes<HTMLTextAreaElement>,
'autoSize'
> {
autoSize?: {
minRows?: number;
maxRows?: number;
@@ -95,9 +97,10 @@ const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
)}
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<Value>();
const handleChange: ChangeEventHandler<HTMLTextAreaElement> = useCallback(

View File

@@ -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) => {
)}
</div>
);
};
}

View File

@@ -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) => {
)}
</div>
);
};
}

View File

@@ -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>(
ChunkTextMode.Full,
@@ -57,4 +57,4 @@ export default ({
)}
</div>
);
};
}

View File

@@ -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();