redacted linkedin
All checks were successful
Rebuild signaller for deprived.dev to rebuild site / test_service (push) Successful in 15s
All checks were successful
Rebuild signaller for deprived.dev to rebuild site / test_service (push) Successful in 15s
This commit is contained in:
parent
c1c3090a2f
commit
2094b85e69
4 changed files with 33 additions and 19 deletions
|
|
@ -1,10 +1,34 @@
|
|||
<script>
|
||||
import QRCode from "$lib/alex/cv-comps/LinkedInQrCode.svg?raw";
|
||||
<script lang="ts">
|
||||
import re from "@src/ts/Redaction/Redactor";
|
||||
|
||||
// Gave up because a little drunk, so rest is chatgpt
|
||||
|
||||
function getHTML(url: string): Promise<string> {
|
||||
return fetch(url, { method: "GET", headers: { Accept: "text/html" } }).then(
|
||||
(res) => {
|
||||
if (!res.ok)
|
||||
throw new Error(`GET ${url} failed: ${res.status} ${res.statusText}`);
|
||||
return res.text();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// recompute the promise when the (store-derived) URL changes
|
||||
$: url = $re?.linkedIn?.imageId || "";
|
||||
$: htmlPromise = url ? getHTML(url) : Promise.resolve("");
|
||||
</script>
|
||||
|
||||
<div class="container">
|
||||
<div>LinkedIn</div>
|
||||
<div class="qrcode corner-border-container p-4">{@html QRCode}</div>
|
||||
<div class="qrcode corner-border-container p-4">
|
||||
{#await htmlPromise}
|
||||
<span>Loading…</span>
|
||||
{:then html}
|
||||
{@html html}
|
||||
{:catch err}
|
||||
<span class="text-red-600">{err.message}</span>
|
||||
{/await}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue