File size: 1,697 Bytes
8ce4d25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from fasthtml.components import Div, Img, Nav, Title, Body, Header, Main
from fasthtml.xtend import A
from lucide_fasthtml import Lucide
from shad4fast import Button, Separator


def Logo():
    return Div(
        Img(src='https://assets.vespa.ai/logos/vespa-logo-black.svg', alt='Vespa Logo', cls='h-full dark:hidden'),
        Img(src='https://assets.vespa.ai/logos/vespa-logo-white.svg', alt='Vespa Logo Dark Mode',
            cls='h-full hidden dark:block'),
        cls='h-[27px]'
    )


def ThemeToggle(variant="ghost", cls=None, **kwargs):
    return Button(
        Lucide("sun", cls="dark:flex hidden"),
        Lucide("moon", cls="dark:hidden"),
        variant=variant,
        size="icon",
        cls=f"theme-toggle {cls}",
        **kwargs,
    )


def Links():
    return Nav(
        A(
            Button(Lucide(icon="github"), size="icon", variant="ghost"),
            href="https://github.com/vespa-engine/vespa",
            target="_blank",
        ),
        A(
            Button(Lucide(icon="slack"), size="icon", variant="ghost"),
            href="https://slack.vespa.ai",
            target="_blank",
        ),
        Separator(orientation="vertical"),
        ThemeToggle(),
        cls='flex items-center space-x-3'
    )


def Layout(*c, **kwargs):
    return (
        Title('Visual Retrieval ColPali'),
        Body(
            Header(
                A(Logo(), href="/"),
                Links(),
                cls='min-h-[55px] h-[55px] w-full flex items-center justify-between px-4'
            ),
            Main(
                *c, **kwargs,
                cls='flex-1 h-full'
            ),
            cls='h-full flex flex-col'
        ),
    )