2025-03-28 14:16:20 +01:00
|
|
|
<script lang="ts">
|
|
|
|
import { fs_encode_path } from "./FilesystemAPI";
|
|
|
|
import type { FSNavigator } from "./FSNavigator";
|
2023-05-30 16:59:11 +02:00
|
|
|
|
2025-03-28 14:16:20 +01:00
|
|
|
export let nav: FSNavigator
|
2023-05-17 15:34:56 +02:00
|
|
|
</script>
|
|
|
|
|
2023-11-15 15:50:54 +01:00
|
|
|
<div class="breadcrumbs">
|
2024-08-09 13:02:07 +02:00
|
|
|
{#each $nav.path as node, i (node.path)}
|
2023-11-15 15:50:54 +01:00
|
|
|
{@const shared = node.id !== undefined && node.id !== "me"}
|
|
|
|
<a
|
|
|
|
href={"/d"+fs_encode_path(node.path)}
|
|
|
|
class="breadcrumb button"
|
2024-08-09 13:02:07 +02:00
|
|
|
class:button_highlight={$nav.base_index === i}
|
|
|
|
on:click|preventDefault={() => {nav.navigate(node.path, true)}}
|
2023-11-15 15:50:54 +01:00
|
|
|
>
|
2024-05-17 16:32:53 +02:00
|
|
|
{#if node.abuse_type !== undefined}
|
|
|
|
<i class="icon small">block</i>
|
|
|
|
{:else if shared}
|
2023-11-15 15:50:54 +01:00
|
|
|
<i class="icon small">share</i>
|
|
|
|
{/if}
|
2024-08-09 13:02:07 +02:00
|
|
|
<div class="node_name" class:base={$nav.base_index === i}>
|
2023-11-15 15:50:54 +01:00
|
|
|
{node.name}
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
{/each}
|
|
|
|
</div>
|
2023-05-17 15:34:56 +02:00
|
|
|
|
|
|
|
<style>
|
2023-11-15 15:50:54 +01:00
|
|
|
.breadcrumbs {
|
|
|
|
flex-grow: 1;
|
|
|
|
flex-shrink: 1;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
flex-direction: row;
|
2023-11-16 12:17:36 +01:00
|
|
|
overflow: hidden;
|
2023-11-15 15:50:54 +01:00
|
|
|
}
|
2023-05-17 15:34:56 +02:00
|
|
|
.breadcrumb {
|
|
|
|
min-width: 1em;
|
|
|
|
text-align: center;
|
|
|
|
word-break: break-all;
|
2024-02-28 15:50:57 +01:00
|
|
|
display: inline-flex;
|
2023-05-17 19:27:46 +02:00
|
|
|
flex-direction: row;
|
|
|
|
}
|
|
|
|
.node_name {
|
2024-04-11 20:32:55 +02:00
|
|
|
max-width: 20vw;
|
2024-04-10 18:35:51 +02:00
|
|
|
overflow-x: hidden;
|
2023-11-15 15:50:54 +01:00
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
2024-02-28 15:50:57 +01:00
|
|
|
.base {
|
2023-11-16 12:17:36 +01:00
|
|
|
/* The base name uses all available space */
|
|
|
|
max-width: unset;
|
2023-05-17 19:27:46 +02:00
|
|
|
}
|
2023-05-17 15:34:56 +02:00
|
|
|
</style>
|