|
1 |
| -import { tmux } from "../tmux.js" |
2 |
| -import { Widget, WidgetIcon, WidgetLabel } from "./widget.js" |
3 |
| -export * from './widget.js' |
| 1 | +import { tmux } from "../tmux.js"; |
| 2 | +import { Widget, WidgetIcon, WidgetLabel } from "./widget.js"; |
| 3 | +export * from "./widget.js"; |
4 | 4 |
|
5 | 5 | type CommonModuleProps = {
|
6 |
| - icon?: string, |
7 |
| -} |
| 6 | + icon?: string; |
| 7 | +}; |
8 | 8 |
|
9 |
| -type HostnameProps = CommonModuleProps |
| 9 | +type HostnameProps = CommonModuleProps; |
10 | 10 |
|
11 | 11 | export const Hostname = ({ icon }: HostnameProps) => {
|
12 | 12 | return (
|
13 | 13 | <Widget>
|
14 |
| - <WidgetIcon> |
15 |
| - {icon ?? ""} |
16 |
| - </WidgetIcon> |
17 |
| - <WidgetLabel> |
18 |
| - {tmux.globals.hostname} |
19 |
| - </WidgetLabel> |
| 14 | + <WidgetIcon>{icon ?? ""}</WidgetIcon> |
| 15 | + <WidgetLabel>{tmux.globals.hostname}</WidgetLabel> |
20 | 16 | </Widget>
|
21 |
| - ) |
22 |
| -} |
| 17 | + ); |
| 18 | +}; |
23 | 19 |
|
24 |
| -type SessionNameProps = CommonModuleProps |
| 20 | +type SessionNameProps = CommonModuleProps; |
25 | 21 |
|
26 | 22 | export const SessionName = ({ icon }: SessionNameProps) => {
|
27 | 23 | return (
|
28 | 24 | <Widget>
|
29 |
| - <WidgetIcon> |
30 |
| - {icon ?? ""} |
31 |
| - </WidgetIcon> |
32 |
| - <WidgetLabel> |
33 |
| - {tmux.globals.sessionName} |
34 |
| - </WidgetLabel> |
| 25 | + <WidgetIcon>{icon ?? ""}</WidgetIcon> |
| 26 | + <WidgetLabel>{tmux.globals.sessionName}</WidgetLabel> |
35 | 27 | </Widget>
|
36 |
| - ) |
37 |
| -} |
| 28 | + ); |
| 29 | +}; |
38 | 30 |
|
39 | 31 | type ClockProps = CommonModuleProps & {
|
40 |
| - format?: string |
41 |
| -} |
| 32 | + format?: string; |
| 33 | +}; |
42 | 34 |
|
43 | 35 | export const Clock = ({ format, icon }: ClockProps) => {
|
44 |
| - const value = format ?? `${tmux.globals.hour_24}:${tmux.globals.minute}` |
| 36 | + const value = format ?? `${tmux.globals.hour_24}:${tmux.globals.minute}`; |
45 | 37 |
|
46 | 38 | return (
|
47 | 39 | <Widget>
|
48 |
| - <WidgetIcon> |
49 |
| - {icon ?? ""} |
50 |
| - </WidgetIcon> |
51 |
| - <WidgetLabel> |
52 |
| - {value} |
53 |
| - </WidgetLabel> |
| 40 | + <WidgetIcon>{icon ?? ""}</WidgetIcon> |
| 41 | + <WidgetLabel>{value}</WidgetLabel> |
54 | 42 | </Widget>
|
55 |
| - ) |
56 |
| -} |
| 43 | + ); |
| 44 | +}; |
57 | 45 |
|
58 |
| -type DateProps = CommonModuleProps & { |
59 |
| - format?: string |
60 |
| -} |
| 46 | +type CalendarProps = CommonModuleProps & { |
| 47 | + format?: string; |
| 48 | +}; |
61 | 49 |
|
62 |
| -export const Date = ({ format, icon }: DateProps) => { |
63 |
| - const value = format ?? `${tmux.globals.month}-${tmux.globals.day}-${tmux.globals.year}` |
| 50 | +export const Calendar = ({ format, icon }: CalendarProps) => { |
| 51 | + const value = |
| 52 | + format ?? `${tmux.globals.month}-${tmux.globals.day}-${tmux.globals.year}`; |
64 | 53 |
|
65 | 54 | return (
|
66 | 55 | <Widget>
|
67 |
| - <WidgetIcon> |
68 |
| - {icon ?? ""} |
69 |
| - </WidgetIcon> |
70 |
| - <WidgetLabel> |
71 |
| - {value} |
72 |
| - </WidgetLabel> |
| 56 | + <WidgetIcon>{icon ?? ""}</WidgetIcon> |
| 57 | + <WidgetLabel>{value}</WidgetLabel> |
73 | 58 | </Widget>
|
74 |
| - ) |
75 |
| -} |
| 59 | + ); |
| 60 | +}; |
0 commit comments