import { PlusOutlined } from "@ant-design/icons"; import { Button, Flex, Input } from "antd"; import { useState } from "react"; interface ModelToolbarProps { keyword: string; onSearch: (value: string) => void; onSearchClear: () => void; openCreateDialog: () => void; } export function ModelToolbar({ keyword, onSearch, onSearchClear, openCreateDialog }: ModelToolbarProps) { const [draftKeyword, setDraftKeyword] = useState(keyword); return ( setDraftKeyword(event.target.value)} onClear={() => { setDraftKeyword(""); onSearchClear(); }} onSearch={(value) => onSearch(value)} placeholder="搜索模型名称或 ID" value={draftKeyword} /> ); }