-
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
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
import { css, html } from "lit-element";
import { FigmaIcon } from "../Icons";
import { fromNow } from "./utils";
export const styles = css`
.figma-footer {
flex: 0;
min-height: 48px;
padding: 0 16px;
text-decoration: none;
display: flex;
flex-direction: row;
justify-content: start;
align-items: center;
background-color: #fff;
overflow-x: auto;
cursor: pointer;
font-size: 12px;
color: rgba(0, 0, 0, 0.8);
}
.figma-footer--icon {
margin-right: 12px;
}
.figma-footer--title {
font-weight: 600;
margin-right: 4px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.figma-footer--timestamp {
white-space: nowrap;
overflow: hidden;
}
`;
export const Footer = (metadata?: {
link: string;
timestamp: Date | string;
fileName: string;
}) => {
if (!metadata) {
return null;
}
const { link, timestamp, fileName } = metadata;
return html`<a
class="figma-footer"
target="_blank"
rel="noopener"
title="Open in Figma"
href="${link}"
>
<span class="figma-footer--icon"> ${FigmaIcon()} </span>
<span class="figma-footer--title"> ${fileName} </span>
<span
title="Last time edited: ${new Date(timestamp).toUTCString()}"
class="figma-footer--timestamp"
>
Edited ${fromNow(timestamp)}
</span>
</a>`;
};