mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
28 lines
1,018 B
TypeScript
28 lines
1,018 B
TypeScript
import { VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react"
|
|
import { useAppTranslation } from "@/i18n/TranslationContext"
|
|
|
|
interface ExperimentalFeatureProps {
|
|
enabled: boolean
|
|
onChange: (value: boolean) => void
|
|
// Additional property to identify the experiment
|
|
experimentKey?: string
|
|
}
|
|
|
|
export const ExperimentalFeature = ({ enabled, onChange, experimentKey }: ExperimentalFeatureProps) => {
|
|
const { t } = useAppTranslation()
|
|
|
|
// Generate translation keys based on experiment key
|
|
const nameKey = experimentKey ? `settings:experimental.${experimentKey}.name` : ""
|
|
const descriptionKey = experimentKey ? `settings:experimental.${experimentKey}.description` : ""
|
|
|
|
return (
|
|
<div>
|
|
<div className="flex items-center gap-2">
|
|
<VSCodeCheckbox checked={enabled} onChange={(e: any) => onChange(e.target.checked)}>
|
|
<span className="font-medium">{t(nameKey)}</span>
|
|
</VSCodeCheckbox>
|
|
</div>
|
|
<p className="text-vscode-descriptionForeground text-sm mt-0">{t(descriptionKey)}</p>
|
|
</div>
|
|
)
|
|
}
|