mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-07 16:30:49 +00:00
Inline code-block while component is loading (#8293)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
parent
97c884a30e
commit
09f69b8555
@ -16,6 +16,7 @@
|
||||
import diffview from '@hcengineering/diffview'
|
||||
import { MarkupNode } from '@hcengineering/text'
|
||||
import { Component } from '@hcengineering/ui'
|
||||
import type { SvelteComponent } from 'svelte'
|
||||
|
||||
export let node: MarkupNode
|
||||
export let preview = false
|
||||
@ -28,8 +29,11 @@
|
||||
$: margin = preview ? '0' : null
|
||||
|
||||
$: props = { value, language }
|
||||
let innerRef: SvelteComponent | undefined
|
||||
</script>
|
||||
|
||||
{#if node}
|
||||
<pre class="proseCodeBlock" style:margin><code><Component {is} {props} /></code></pre>
|
||||
<pre class="proseCodeBlock" style:margin><code
|
||||
><Component {is} {props} showLoading={false} bind:innerRef />{#if !innerRef}{value}{/if}</code
|
||||
></pre>
|
||||
{/if}
|
||||
|
Loading…
Reference in New Issue
Block a user