Files
testing-tool/src/pages/Jwt/index.tsx
T
雨霖铃 06b9d29270 feat(Jwt): 重构 JWT 组件,新增常量和结果视图
- 新增 constants.ts 文件,定义 JWT 输入占位符和配置常量,提升代码可读性。
- 删除 JwtSection 组件,重构为 JwtResultView 组件,简化结果展示逻辑。
- 更新 index.tsx,使用 JwtResultView 组件替代原有的 JWT 结果展示方式,优化页面结构。
2026-06-19 10:31:40 +08:00

27 lines
771 B
TypeScript

import TextInputArea from '@/components/TextInputArea';
import JwtResultView from './components/JwtResultView';
import { JWT_INPUT_PLACEHOLDER } from './constants';
import { useJwt } from './useJwt';
export default function Index() {
const { jwtInput, result, handleChange, handleClear } = useJwt();
return (
<div className="p-4 w-full flex flex-col gap-4 select-none">
<TextInputArea
minRows={5}
maxRows={10}
placeholder={JWT_INPUT_PLACEHOLDER}
value={jwtInput}
onChange={handleChange}
allowCopy={true}
showClear={true}
externalError={result?.error || undefined}
onClear={handleClear}
/>
{result && !result.error && <JwtResultView result={result} />}
</div>
);
}