"use strict";

const React = require("react");

const context = require("./context");

function Link(props) {
	let { handle } = React.useContext(context);

	let {
		url, children,
		/* The following is covered by the `url` prop already. */
		href: _href,
		...rest
	} = props;

	return (
		<a href="#" onClick={() => handle("get", url)} {...rest}>
			{children}
		</a>
	);
}

module.exports = Link;
