| 1 | <script lang="ts"> |
| 2 | import { invoke } from "@tauri-apps/api/core"; |
| 3 | import EditOff from "carbon-icons-svelte/lib/EditOff.svelte"; |
| 4 | export let hidden = false; |
| 5 | export let path = ""; |
| 6 | </script> |
| 7 | |
| 8 | <div class="container" class:hidden> |
| 9 | <div class="unsupported"> |
| 10 | <EditOff size={32} /> |
| 11 | <span class="desc">The file cannot be displayed because it is either binary or uses an unsupported text encoding.</span> |
| 12 | <span class="link" on:click={() => {invoke("open_in_explorer", {path: path})}}>Open in File Explorer</span> |
| 13 | </div> |
| 14 | </div> |
| 15 | |
| 16 | <style lang="scss"> |
| 17 | .container { |
| 18 | height: 100%; |
| 19 | display: flex; |
| 20 | .unsupported { |
| 21 | display: flex; |
| 22 | flex-direction: column; |
| 23 | align-items: center; |
| 24 | justify-content: center; |
| 25 | height: 60%; |
| 26 | width: 100%; |
| 27 | :global(svg) { |
| 28 | width: 48px; |
| 29 | height: 48px; |
| 30 | padding: 20px 0; |
| 31 | } |
| 32 | .link { |
| 33 | font-size: 0.9rem; |
| 34 | cursor: pointer; |
| 35 | text-decoration: underline; |
| 36 | padding: 5px 0; |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | .hidden { |
| 41 | display: none !important; |
| 42 | } |
| 43 | </style> |