colouring-montreal/app/src/frontend/map/data-switcher.tsx
2022-12-08 20:45:33 +01:00

20 lines
600 B
TypeScript

import React from 'react';
import './data-switcher.css';
interface DataLayerSwitcherProps {
currentDisplay: string;
onSubmit: (e: React.FormEvent<HTMLFormElement>) => void;
}
const DataLayerSwitcher: React.FC<DataLayerSwitcherProps> = (props) => (
<form className={`data-switcher ${props.currentDisplay}`} onSubmit={props.onSubmit}>
<button className="btn btn-outline btn-outline-dark"
type="submit">
{(props.currentDisplay === 'enabled')? 'Hide layer options' : 'Show layer options'}
</button>
</form>
);
export default DataLayerSwitcher;