aboutsummaryrefslogtreecommitdiff
path: root/source/library/components/ResultViewer.svelte
diff options
context:
space:
mode:
Diffstat (limited to 'source/library/components/ResultViewer.svelte')
-rw-r--r--source/library/components/ResultViewer.svelte16
1 files changed, 14 insertions, 2 deletions
diff --git a/source/library/components/ResultViewer.svelte b/source/library/components/ResultViewer.svelte
index e2c74fe..083828d 100644
--- a/source/library/components/ResultViewer.svelte
+++ b/source/library/components/ResultViewer.svelte
@@ -1,13 +1,15 @@
<script lang="ts">
import Editor from "./Editor.svelte";
import type { Extension } from "@codemirror/state";
+ import type { Snippet } from "svelte";
type Props = {
+ footer?: Snippet<[{ result: string }]>;
theme?: Extension;
value: string;
};
- let { theme, value }: Props = $props();
+ let { footer, theme, value }: Props = $props();
function noop(_v: string) {}
</script>
@@ -15,7 +17,7 @@
<style lang="scss">
.result {
display: grid;
- grid-template-rows: auto 1fr;
+ grid-template-rows: auto 1fr auto;
height: 100%;
min-height: 0;
}
@@ -27,9 +29,19 @@
padding: 0.25rem 0.75rem;
text-transform: uppercase;
}
+
+ .footer {
+ background: var(--graphiql-panel, #252526);
+ border-top: 1px solid var(--graphiql-border, #333);
+ font-size: 0.75rem;
+ padding: 0.25rem 0.75rem;
+ }
</style>
<div class="result">
<div class="label">Response</div>
<Editor language="json" onChange={noop} readOnly {theme} {value}/>
+ {#if footer}
+ <div class="footer">{@render footer({ result: value })}</div>
+ {/if}
</div>