2023-04-26 15:17:23 +00:00
|
|
|
import { Checkbox } from '@vegaprotocol/ui-toolkit';
|
|
|
|
import { t } from '@vegaprotocol/i18n';
|
|
|
|
import { useTelemetryApproval } from '../../lib/hooks/use-telemetry-approval';
|
|
|
|
|
2023-05-02 21:01:33 +00:00
|
|
|
export const TelemetryApproval = ({ helpText }: { helpText: string }) => {
|
2023-04-26 15:17:23 +00:00
|
|
|
const [isApproved, setIsApproved] = useTelemetryApproval();
|
|
|
|
return (
|
2023-05-19 21:27:45 +00:00
|
|
|
<div className="flex flex-col py-3">
|
2023-04-26 15:17:23 +00:00
|
|
|
<div className="mr-4" role="form">
|
|
|
|
<Checkbox
|
|
|
|
label={<span className="text-lg pl-1">{t('Share usage data')}</span>}
|
|
|
|
checked={isApproved}
|
|
|
|
name="telemetry-approval"
|
|
|
|
onCheckedChange={() => setIsApproved(!isApproved)}
|
|
|
|
/>
|
|
|
|
</div>
|
2023-04-27 07:38:57 +00:00
|
|
|
<div className="text-sm text-vega-light-300 dark:text-vega-dark-300 ml-6">
|
2023-05-02 21:01:33 +00:00
|
|
|
<span>{helpText}</span>
|
2023-04-26 15:17:23 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|