30 lines
619 B
Svelte
30 lines
619 B
Svelte
<script lang="ts">
|
|
import { Link, useLocation } from "svelte-navigator";
|
|
import type { Address, VALUE_TYPE } from "upend/types";
|
|
export let to: IPointer;
|
|
|
|
interface IPointer {
|
|
entity?: Address;
|
|
attribute?: string;
|
|
value?: { t: VALUE_TYPE; c: string };
|
|
}
|
|
|
|
const location = useLocation();
|
|
|
|
let routerTo = "#";
|
|
$: {
|
|
if ($location.pathname.startsWith("/browse") && to.entity) {
|
|
routerTo = `${$location.pathname},${to.entity}`;
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<Link class="uplink" to={routerTo}>
|
|
<slot />
|
|
</Link>
|
|
|
|
<style lang="scss">
|
|
:global(.uplink) {
|
|
text-decoration: none;
|
|
}
|
|
</style>
|