summaryrefslogtreecommitdiff
path: root/src/components/jet/item/SearchLinkItem.svelte
blob: cd60512848c5ddc0459723bd383188a81bccd153 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<script lang="ts">
    import {
        isFlowAction,
        type SearchLink,
    } from '@jet-app/app-store/api/models';

    import FlowAction from '~/components/jet/action/FlowAction.svelte';
    import MagnifyingGlass from '~/sf-symbols/magnifyingglass.svg';

    export let item: SearchLink;
</script>

{#if isFlowAction(item.clickAction)}
    <div class="link-container">
        <FlowAction destination={item.clickAction}>
            <MagnifyingGlass class="icon" />
            {item.title}
        </FlowAction>
    </div>
{/if}

<style>
    .link-container {
        display: contents;
    }

    .link-container :global(a) {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 12px;
        font: var(--title-2);
        border-radius: var(--global-border-radius-large);
        background: var(--systemQuinary);
    }

    .link-container :global(a:hover) {
        text-decoration: none;
    }

    .link-container :global(a) :global(.icon) {
        overflow: visible;
        width: 20px;
        fill: currentColor;
    }
</style>