-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
172 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { FunctionComponent } from 'preact'; | ||
|
||
interface DepthControlProps { | ||
depth: number; | ||
onDepthChange: (newDepth: number) => void; | ||
} | ||
|
||
export const DepthControl: FunctionComponent<DepthControlProps> = ({ depth, onDepthChange }) => { | ||
return ( | ||
<div className="depth-control-section"> | ||
<h2>搜索深度控制</h2> | ||
<div className="depth-slider-container"> | ||
<label htmlFor="depth-slider">当前深度: {depth}</label> | ||
<input | ||
id="depth-slider" | ||
type="range" | ||
min="10" | ||
max="30" | ||
value={depth} | ||
onChange={(e) => { | ||
if (e.target instanceof HTMLInputElement) { | ||
onDepthChange(Number(e.target.value)); | ||
} | ||
}} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.