import { For, createSignal, onMount } from "solid-js"

const redirect = (link: string) => {
    window.location.href = (atob(link))
}

const [text, setText] = createSignal("")




export const DecryptLink = (props: {linkTo: string, text:string}) => {
    console.log(props.text)
    onMount(async ()=> {
        setTimeout(() => {
            setText(atob(props.text))
        }, 100);
    })
    return <For each={[1]}>{(i)=> <p id={Date.now.toString()} class="cursor-pointer" onclick={()=>redirect(props.linkTo)}>{text()}</p>}</For>
}