import { defineComponent } from "vue";

export default defineComponent({
    name: "dj-email",
    setup(_props, { slots }) {
        function clickMail() {
            const a = "gmail";
            const b = "com";
            const c = "danjledda";
            let link = "ma" + "il" + "" + "to:" + c + a + b;
            link = link.slice(0, 10) + "." + link.slice(10, 11) + "." + link.slice(11, 16) + "@" + link.slice(16, 21) +
                "." + link.slice(21);
            window.location.href = link;
        }
        return () => (
            <a href="#" onClick={clickMail}>
                { slots.default ? slots.default() : 'dan.j.ledda [at] gmail [dot] com' }
            </a>
        );
    },
});
