Files
testing-tool/src/pages/JsonTools/JsonDiffInput.tsx
T
雨霖铃 e140af7698 refactor: remove meaningless comments
Remove 50+ noise comments across the codebase:
- AI-generated verbose prose (💡 emoji, '超进化', '大闸', etc.)
- Comments that restate what the code obviously does
- Comments about deleted code
- Import-level noise comments
- Overly verbose Chinese section markers

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-28 20:37:52 +08:00

43 lines
1.0 KiB
TypeScript

import React from 'react';
import TextInputArea from '@/components/TextInputArea';
import { cn } from '@/lib/utils';
export interface JsonDiffInputProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
label: string;
placeholder: string;
value: string;
onChange: (value: string) => void;
error?: string | null;
minRows?: number;
}
export default function JsonDiffInput({
label,
placeholder,
value,
onChange,
error,
minRows = 10,
className,
...props
}: JsonDiffInputProps) {
return (
<div className={cn('flex-1 min-w-0 flex flex-col', className)} {...props}>
<span className="block mb-2 text-[10px] font-bold tracking-wide text-muted-foreground/80 uppercase select-none px-0.5">
{label}
</span>
<TextInputArea
value={value}
onChange={onChange}
placeholder={placeholder}
minRows={minRows}
maxRows={16}
externalError={error ?? undefined}
showClear={true}
allowCopy={true}
/>
</div>
);
}