'use strict';

const React = require("react");

const defaultStyle = require("./style.css");
const useTheme = require("../../util/themeable");

module.exports = function Icon({ icon }) {
	// FIXME: Figure out a better way to test stuff than symlinking ui-lib react into site-builder react...
	let { withTheme } = useTheme({ control: "icon", defaultStyle });
	
	// FIXME: Don't hardcode icon base path, get it from theme
	return (
		<img className={withTheme("uilibComponent", "icon")} src={`/images/icons/${icon}.svg`} />
	);
};
