Files

30 lines
826 B
Svelte
Raw Permalink Normal View History

2023-10-02 23:10:49 +03:00
<script>
import { getContext } from "svelte";
const channelurl = getContext("channelurl");
export let field;
export let value;
export let schema;
2026-05-07 22:50:02 +03:00
let id = self.crypto.randomUUID();
2023-10-02 23:10:49 +03:00
</script>
<div class="mb-0">
<div class="d-flex justify-content-between">
<label for={id} class="form-label">{field.label}</label>
<a
class="text-decoration-none"
href="{channelurl}/schemas/{schema.name}/fields/edit/{field.name}"
><code class="text-primary opacity-50">{field.name}</code></a
>
</div>
<input
type="url"
{id}
class="form-control"
bind:value
placeholder="https://www.example.com"
/>
{#if field.help}
2026-05-07 22:50:02 +03:00
<small class=" text-primary opacity-50">{field.help}</small>
2023-10-02 23:10:49 +03:00
{/if}
</div>