|
|
|
@ -18,6 +18,10 @@ export interface Props {
|
|
|
|
|
dataCy?: string;
|
|
|
|
|
disabled?: boolean;
|
|
|
|
|
featureId?: FeatureId;
|
|
|
|
|
switchValues?: {
|
|
|
|
|
on: string;
|
|
|
|
|
off: string;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function SwitchField({
|
|
|
|
@ -30,6 +34,7 @@ export function SwitchField({
|
|
|
|
|
disabled,
|
|
|
|
|
onChange,
|
|
|
|
|
featureId,
|
|
|
|
|
switchValues,
|
|
|
|
|
}: Props) {
|
|
|
|
|
const toggleName = name ? `toggle_${name}` : '';
|
|
|
|
|
|
|
|
|
@ -55,6 +60,12 @@ export function SwitchField({
|
|
|
|
|
featureId={featureId}
|
|
|
|
|
dataCy={dataCy}
|
|
|
|
|
/>
|
|
|
|
|
{switchValues && checked && (
|
|
|
|
|
<span className="ml-2">{switchValues.on}</span>
|
|
|
|
|
)}
|
|
|
|
|
{switchValues && !checked && (
|
|
|
|
|
<span className="ml-2">{switchValues.off}</span>
|
|
|
|
|
)}
|
|
|
|
|
</label>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|