Files
lucent-laravel/front/js/svelte/records/PreviewCardSmall.svelte
T

40 lines
907 B
Svelte
Raw Normal View History

2023-10-02 23:10:49 +03:00
<script>
import {previewTitle} from "./Preview";
import {getContext} from "svelte";
const channel = getContext("channel");
export let record;
export let graph;
$: schema = channel.schemas.find((aschema) => aschema.name === record._sys.schema);
$: title = previewTitle(channel.schemas, record, graph);
</script>
{#if record?.data}
<a
href="{channel.lucentUrl}/records/{record.id}"
class="text-decoration-none rounded py-1 px-2 d-inline-block"
{title}
style="border:2px solid {!schema.color
? '#999'
: schema.color}!important;white-space: nowrap;"
>
{title}
</a>
{/if}
<style>
a {
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
font-size: 13px;
color: #333;
}
a:hover {
opacity: 0.5;
/* color: #fff; */
}
</style>