# blockspare/2.7.1/admin/components/Switch.js

BlockSpare – Gutenberg Blocks for News, Magazine, Blog &amp; Business Websites, version 2.7.1. 16 lines.

- Page: https://pluginprobe.com/plugins/blockspare/2.7.1/code/admin/components/Switch.js
- Raw: https://pluginprobe.com/plugins/blockspare/2.7.1/raw/admin/components/Switch.js
- Modified: 2023-11-07T14:26:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/blockspare/2.7.1/code/admin/components/Switch.js#L10-L20`.

```javascript
import React from 'react'

const Switch = ({data, handleChange}) => {
    return (
        <div className="control-wrapper blocksape-dashboard__switch-control">
            <label className="control-title" for={`blockspare-dashboard-${data.slug}`}>
                <input id={`blockspare-dashboard-${data.slug}`} onChange={(event) => handleChange(event, data.slug)} type="checkbox" checked={data.isEnabled} name={data.name} />
                <span className="switch" ></span>
            </label>
            <span className="control-description"></span>
        </div>
    )
}

export default Switch

```
