Roo-Code/webview-ui/src/components/settings/RateLimitSecondsControl.tsx
Chris Estreich 62d8cc0d66
Batch settings updates from the webview to the extension host (#9165)
Co-authored-by: Roo Code <roomote@roocode.com>
2025-11-12 12:29:06 -08:00

25 lines
847 B
TypeScript

import { useAppTranslation } from "@/i18n/TranslationContext"
import { Slider } from "@/components/ui"
interface RateLimitSecondsControlProps {
value: number
onChange: (value: number) => void
}
export const RateLimitSecondsControl = ({ value, onChange }: RateLimitSecondsControlProps) => {
const { t } = useAppTranslation()
return (
<div className="flex flex-col gap-1">
<label className="block font-medium mb-1">{t("settings:providers.rateLimitSeconds.label")}</label>
<div className="flex items-center gap-2">
<Slider value={[value]} min={0} max={60} step={1} onValueChange={(newValue) => onChange(newValue[0])} />
<span className="w-10">{value}s</span>
</div>
<div className="text-sm text-vscode-descriptionForeground">
{t("settings:providers.rateLimitSeconds.description", { value })}
</div>
</div>
)
}