Roo-Code/webview-ui/src/components/settings/MaxLimitInputs.tsx
Matt Rubens 305a5da369
Clean up the auto-approve UI (#6538)
* Clean up the auto-approve UI

* Update webview-ui/src/components/settings/AutoApproveSettings.tsx

Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>

* Fix

* Translations

---------

Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
2025-08-01 07:49:42 -04:00

32 lines
1,018 B
TypeScript

import React from "react"
import { useTranslation } from "react-i18next"
import { MaxRequestsInput } from "./MaxRequestsInput"
import { MaxCostInput } from "./MaxCostInput"
export interface MaxLimitInputsProps {
allowedMaxRequests?: number
allowedMaxCost?: number
onMaxRequestsChange: (value: number | undefined) => void
onMaxCostChange: (value: number | undefined) => void
}
export const MaxLimitInputs: React.FC<MaxLimitInputsProps> = ({
allowedMaxRequests,
allowedMaxCost,
onMaxRequestsChange,
onMaxCostChange,
}) => {
const { t } = useTranslation()
return (
<div className="space-y-2">
<div className="grid grid-cols-[auto_1fr] gap-x-2 gap-y-2 items-center">
<MaxRequestsInput allowedMaxRequests={allowedMaxRequests} onValueChange={onMaxRequestsChange} />
<MaxCostInput allowedMaxCost={allowedMaxCost} onValueChange={onMaxCostChange} />
</div>
<div className="text-xs text-vscode-descriptionForeground">
{t("settings:autoApprove.maxLimits.description")}
</div>
</div>
)
}