-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(browser): allow preview and open in the editor screenshot error …
…from ui (#6113)
- Loading branch information
Showing
4 changed files
with
161 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<script setup lang="ts"> | ||
defineProps<{ | ||
file: string | ||
name: string | ||
url?: string | ||
}>() | ||
const emit = defineEmits<{ (e: 'close'): void }>() | ||
onKeyStroke('Escape', () => { | ||
emit('close') | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div w-350 max-w-screen h-full flex flex-col> | ||
<div p-4 relative border="base b"> | ||
<p>Screenshot error</p> | ||
<p op50 font-mono text-sm> | ||
{{ file }} | ||
</p> | ||
<p op50 font-mono text-sm> | ||
{{ name }} | ||
</p> | ||
<IconButton | ||
icon="i-carbon:close" | ||
title="Close" | ||
absolute | ||
top-5px | ||
right-5px | ||
text-2xl | ||
@click="emit('close')" | ||
/> | ||
</div> | ||
|
||
<div class="scrolls" grid="~ cols-1 rows-[min-content]" p-4> | ||
<img | ||
v-if="url" | ||
:src="url" | ||
:alt="`Screenshot error for '${name}' test in file '${file}'`" | ||
border="base t r b l dotted red-500" | ||
> | ||
<div v-else> | ||
Something was wrong, the image cannot be resolved. | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.scrolls { | ||
place-items: center; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters