gm-web-components
Version:
Web components for GamaSmart
39 lines (38 loc) • 1.18 kB
JavaScript
// import { Component, Prop, h, getAssetPath, Host, State } from "@stencil/core";
// @Component({
// tag: "icon-component",
// styleUrl: "icon-component.scss",
// shadow: true
// })
// export class MyComponent {
// @Prop() imga: string;
// @Prop() desca: string;
// @Prop() urla: string;
// @State() imgas: string;
// componentWillLoad() {
// this.imgas = this.imga;
// console.log("Hvata ga stejt", this.imgas);
// }
// componentDidLoad() {
// console.log("The component has been rendered");
// console.log(this.imgas);
// console.log(this.desca);
// console.log(this.urla);
// }
// render() {
// <div>{this.imgas}</div>;
// // <div class="logo-container">
// {
// /* <img src={getAssetPath(`./assets/${this.imga}`)} />
// <a href={this.urla} target="_blank"> */
// }
// {
// /* </a> */
// }
// // </div>;
// }
// }
import { h } from "@stencil/core";
export const IconComponent = ({ img, title, destination }) => (h("div", { class: "logo-container" },
h("img", { src: img }),
h("a", { href: destination, target: "_blank" }, title)));