添加搜索框的重置按钮
This commit is contained in:
@@ -3,7 +3,7 @@ import type { ExamClient, ExamModalTab } from '../../data/mockData';
|
|||||||
import { EXAM_TAGS } from '../../data/mockData';
|
import { EXAM_TAGS } from '../../data/mockData';
|
||||||
import { getTodayExamProgress } from '../../api';
|
import { getTodayExamProgress } from '../../api';
|
||||||
import { isExamActionDone } from '../../utils/examActions';
|
import { isExamActionDone } from '../../utils/examActions';
|
||||||
import { Badge, Card, CardContent, CardHeader, InfoCard, Input } from '../ui';
|
import { Badge, Button, Card, CardContent, CardHeader, InfoCard, Input } from '../ui';
|
||||||
import { cls } from '../../utils/cls';
|
import { cls } from '../../utils/cls';
|
||||||
|
|
||||||
interface ExamSectionProps {
|
interface ExamSectionProps {
|
||||||
@@ -139,13 +139,21 @@ export const ExamSection = ({
|
|||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
<div className='w-[320px]'>
|
<div className='w-[320px] flex items-center gap-2'>
|
||||||
<Input
|
<Input
|
||||||
placeholder='搜索 姓名 / 手机号 / 身份证号 / 卡号'
|
placeholder='搜索 姓名 / 手机号 / 身份证号 / 卡号'
|
||||||
value={debouncedInputValue}
|
value={debouncedInputValue}
|
||||||
onChange={(e) => setDebouncedInputValue(e.target.value)}
|
onChange={(e) => setDebouncedInputValue(e.target.value)}
|
||||||
className='text-sm'
|
className='text-sm flex-1'
|
||||||
/>
|
/>
|
||||||
|
{debouncedInputValue && (
|
||||||
|
<Button
|
||||||
|
className='px-3 py-1.5 text-xs whitespace-nowrap'
|
||||||
|
onClick={() => setDebouncedInputValue('')}
|
||||||
|
>
|
||||||
|
重置
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<Card>
|
<Card>
|
||||||
<CardHeader>
|
<CardHeader>
|
||||||
|
|||||||
Reference in New Issue
Block a user