diff options
Diffstat (limited to 'client/src/Components/Response.svelte')
| -rw-r--r-- | client/src/Components/Response.svelte | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/client/src/Components/Response.svelte b/client/src/Components/Response.svelte new file mode 100644 index 0000000..215af1b --- /dev/null +++ b/client/src/Components/Response.svelte @@ -0,0 +1,33 @@ +<script lang="ts"> + import type { ShortenRequest } from "$actions/shorten"; + + export let info: ShortenRequest; +</script> + +<style> + div { + display: flex; + justify-content: space-between; + } + + .url { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + .output { + margin-left: 50px; + } +</style> + +<div> + <span class="url">{info.url}</span> + {#await info.response} + <span class="output">Loading...</span> + {:then { hash }} + <a class="output" href="https://sho.rest/{hash}">sho.rest/{hash}</a> + {:catch { error }} + <span class="output">{error}</span> + {/await} +</div> \ No newline at end of file |
