1
1
---
2
2
import type { HTMLAttributes } from ' astro/types' ;
3
+ import type { NotesTypeType } from ' @src/utils/types' ;
3
4
4
5
interface Props extends HTMLAttributes <' div' > {
5
- type? : ' info ' | ' warning ' | ' important ' | ' tip ' ;
6
+ type? : NotesTypeType ;
6
7
}
7
8
8
9
const { type = ' info' , class : className, ... rest } = Astro .props ;
@@ -16,6 +17,7 @@ const { type = 'info', class: className, ...rest } = Astro.props;
16
17
' note-warning' : type === ' warning' ,
17
18
' note-important' : type === ' important' ,
18
19
' note-tip' : type === ' tip' ,
20
+ ' note-needs_checking' : type === ' needs_checking' ,
19
21
},
20
22
className
21
23
]}
@@ -61,6 +63,16 @@ const { type = 'info', class: className, ...rest } = Astro.props;
61
63
</span >
62
64
)}
63
65
66
+ { type === ' needs_checking' && (
67
+ <span style = " font-size: 1.2rem;" ><strong >This article needs checking:</strong ></span >
68
+ <span class = " note-icon" aria-label = " Important" >
69
+ <svg width = " 28" height = " 28" viewBox = " 0 0 20 20" fill = " none" aria-hidden = " true" >
70
+ <circle cx = " 10" cy = " 10" r = " 10" fill = " #008dd4" />
71
+ <text x = " 10" y = " 15" text-anchor = " middle" font-size = " 14" fill = " #fff" font-family = " Arial" font-weight = " bold" >!</text >
72
+ </svg >
73
+ </span >
74
+ )}
75
+
64
76
<slot />
65
77
</div >
66
78
@@ -78,7 +90,8 @@ const { type = 'info', class: className, ...rest } = Astro.props;
78
90
.custom-note-box.note-info,
79
91
.custom-note-box.note-warning,
80
92
.custom-note-box.note-important,
81
- .custom-note-box.note-tip {
93
+ .custom-note-box.note-tip,
94
+ .custom-note-box.note-needs_checking {
82
95
padding-left: 3.5rem;
83
96
padding-right: 1.25rem;
84
97
}
@@ -99,6 +112,10 @@ const { type = 'info', class: className, ...rest } = Astro.props;
99
112
border-left-color: #4caf50;
100
113
}
101
114
115
+ .custom-note-box.note-needs_checking {
116
+ border-left-color: #008dd4;
117
+ }
118
+
102
119
.note-icon {
103
120
position: absolute;
104
121
top: 50%;
0 commit comments