react-code-dataset / wp-calypso /client /sites /deployments /components /automatic-activation-toggle /index.tsx
react-code-dataset / wp-calypso /client /sites /deployments /components /automatic-activation-toggle /index.tsx
Download wp-calypso/client/sites/deployments/components/automatic-activation-toggle/index.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 942 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/sites/deployments/components/automatic-activation-toggle/index.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/sites/deployments/components/automatic-activation-toggle/index.tsx
-
curl -L -o index.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/sites/deployments/components/automatic-activation-toggle/index.tsx
942 Bytes
| import { FormLabel } from '@automattic/components'; | |
| import { FormToggle } from '@wordpress/components'; | |
| import { useI18n } from '@wordpress/react-i18n'; | |
| import FormFieldset from 'calypso/components/forms/form-fieldset'; | |
| import './style.scss'; | |
| interface AutomaticActivationToggleProps { | |
| onChange( value: boolean ): void; | |
| value: boolean; | |
| type: string; | |
| } | |
| export const AutomaticActivationToggle = ( { | |
| onChange, | |
| value, | |
| type, | |
| }: AutomaticActivationToggleProps ) => { | |
| const { __ } = useI18n(); | |
| const text = | |
| type === 'plugin' | |
| ? __( 'Activate plugin after first successful deployment' ) | |
| : __( 'Activate theme after first deployment' ); | |
| return ( | |
| <FormFieldset> | |
| <FormLabel htmlFor="is-automated">{ __( 'Activate' ) }</FormLabel> | |
| <div className="automated-deployments-toggle-switch"> | |
| <FormToggle id="is-automated" onChange={ () => onChange( ! value ) } checked={ value } /> | |
| { text } | |
| </div> | |
| </FormFieldset> | |
| ); | |
| }; | |