2022-12-31 17:44:53 +05:30
|
|
|
<script lang="ts">
|
2022-08-31 16:46:12 +05:30
|
|
|
import HCaptcha from "svelte-hcaptcha";
|
2022-08-17 23:38:10 +05:30
|
|
|
import { Note } from "$lib/Form";
|
|
|
|
|
2022-08-31 16:46:12 +05:30
|
|
|
let submit = false;
|
2022-08-17 23:38:10 +05:30
|
|
|
|
2022-12-27 20:58:47 +05:30
|
|
|
const showSubmitButton = () => {
|
2022-08-31 16:46:12 +05:30
|
|
|
submit = !submit;
|
|
|
|
};
|
2022-12-31 17:44:53 +05:30
|
|
|
|
2023-01-01 17:57:24 +05:30
|
|
|
export let sitekey: string = "";
|
2022-08-17 23:38:10 +05:30
|
|
|
</script>
|
|
|
|
|
2022-08-31 16:46:12 +05:30
|
|
|
<Note
|
|
|
|
content="The submit button will be visible when you complete the Captcha."
|
2023-01-05 22:42:43 +05:30
|
|
|
icon="i-ic:outline-info text-xl"
|
2022-08-31 16:46:12 +05:30
|
|
|
/>
|
2022-08-17 23:38:10 +05:30
|
|
|
<HCaptcha
|
2022-12-31 17:44:53 +05:30
|
|
|
{sitekey}
|
2022-08-31 16:46:12 +05:30
|
|
|
on:success={showSubmitButton}
|
2022-08-17 23:38:10 +05:30
|
|
|
/>
|
2022-12-30 22:32:49 +05:30
|
|
|
|
|
|
|
<slot />
|
|
|
|
|
2022-08-17 23:38:10 +05:30
|
|
|
{#if submit}
|
2022-12-30 22:32:49 +05:30
|
|
|
<button
|
2022-12-27 20:58:47 +05:30
|
|
|
type="submit"
|
|
|
|
value="Submit"
|
|
|
|
class="form-button"
|
2022-12-30 22:32:49 +05:30
|
|
|
>
|
|
|
|
Submit
|
|
|
|
</button>
|
2022-08-31 16:46:12 +05:30
|
|
|
{/if}
|