1+ ---
2+ import List from " @components/List/index.astro"
3+ import Marker from " @components/List/marker.astro"
4+
5+ const lastUpdatedDate = new Date ()
6+ const lastUpdatedIso = lastUpdatedDate .toISOString ()
7+ const lastUpdatedText = lastUpdatedDate .toLocaleDateString (' en-US' , {
8+ year: ' numeric' ,
9+ month: ' long' ,
10+ day: ' numeric' ,
11+ })
12+
13+ export type Props = {
14+ content: {
15+ header: {
16+ title: string
17+ description: string
18+ }
19+ nav: {
20+ title: string
21+ items: {
22+ label: string
23+ href: string
24+ }[]
25+ }
26+ collection: {
27+ title: string
28+ cards: {
29+ title: string
30+ description: string
31+ listItems: {
32+ text: string
33+ icon: string
34+ color: string
35+ }[]
36+ listMarkerSize? : number
37+ trailer? : string
38+ }[]
39+ }
40+ usage: {
41+ title: string
42+ description: string
43+ listItems: {
44+ title: string
45+ description: string
46+ icon: string
47+ color: string
48+ background: string
49+ }[]
50+ listMarkerSize? : number
51+ }
52+ sharing: {
53+ title: string
54+ subtitle: string
55+ description: string
56+ listItems: {
57+ text: string
58+ color: string
59+ }[]
60+ }
61+ }
62+ }
63+
64+ type NavItem = Props [' content' ][' nav' ][' items' ][number ]
65+ type CollectionCard = Props [' content' ][' collection' ][' cards' ][number ]
66+
67+ const { content }: Props = Astro .props
68+
69+ const navItems: Array <NavItem & { showSeparator: boolean }> = []
70+
71+ for (const [index, item] of content .nav .items .entries ()) {
72+ navItems .push ({
73+ ... item ,
74+ showSeparator: index < content .nav .items .length - 1 ,
75+ })
76+ }
77+ ---
78+
79+ <header class =" text-center max-w-2xl mx-auto mb-8" >
80+ <div class =" inline-flex items-center justify-center w-18 h-18 rounded-full bg-primary/10 mb-5" >
81+ <svg class =" w-12 h-12" fill =" none" stroke =" var(--theme-color-page-inverse)" viewBox =" 0 0 24 24" aria-hidden =" true" focusable =" false" >
82+ <path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 1.5" d =" M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z" ></path >
83+ </svg >
84+ </div >
85+ <h1 class =" text-4xl md:text-5xl font-bold text-page-inverse mb-4" >{ content .header .title } </h1 >
86+ <p class =" text-lg text-content-offset leading-relaxed mb-4" >
87+ { content .header .description }
88+ </p >
89+ <p class =" text-sm text-page-inverse italic" >
90+ Last updated: <time datetime ={ lastUpdatedIso } >{ lastUpdatedText } </time >
91+ </p >
92+ </header >
93+
94+ <nav aria-label =" Privacy policy sections" class =" bg-content-active rounded-xl p-6 mb-8" >
95+ <p class =" text-md font-semibold text-content-inverse mb-3" >{ content .nav .title } </p >
96+ <div class =" flex flex-wrap items-center gap-y-2 md:gap-x-2 text-md md:ml-6" >
97+ {
98+ navItems .map (({ href , label , showSeparator }) => (
99+ <>
100+ <a
101+ href = { href }
102+ class = " text-content-inverse hover:text-content-offset transition-colors no-underline"
103+ >
104+ { label }
105+ </a >
106+ { showSeparator && (
107+ <span class = " mx-2 text-trim" aria-hidden = " true" >·</span >
108+ )}
109+ </>
110+ ))
111+ }
112+ </div >
113+ </nav >
114+
115+ <div class =" prose prose-lg max-w-none text-content" >
116+ <section class =" mb-12" aria-labelledby =" privacy-information-we-collect-title" >
117+ <h2 class =" text-2xl md:text-3xl font-bold mb-6" id =" privacy-information-we-collect-title" >
118+ { content .collection .title }
119+ </h2 >
120+
121+ <div class =" grid grid-cols-1 md:grid-cols-2 gap-4" >
122+ {
123+ content .collection .cards .map ((card : CollectionCard ) => (
124+ <div class = " text-content-active bg-page-offset rounded-xl px-8 pt-8 pb-4 shadow-md" >
125+ <h3 class = " text-2xl font-semibold mb-4 mt-0" >
126+ { card .title }
127+ </h3 >
128+ <p class = " mb-2" >
129+ { card .description }
130+ </p >
131+ <List
132+ variant = " plain-icon-list"
133+ items = { card .listItems }
134+ />
135+ { card .trailer && (
136+ <p class = " mt-6 mb-0 text-sm italic text-center text-content-offset" >
137+ { card .trailer }
138+ </p >
139+ )}
140+ </div >
141+ ))
142+ }
143+ </div >
144+ </section >
145+
146+ <section class =" mb-12" aria-labelledby =" privacy-how-we-use-title" >
147+ <h2 class =" text-2xl md:text-3xl font-bold mb-6" id =" privacy-how-we-use-title" >
148+ { content .usage .title }
149+ </h2 >
150+
151+ <div class =" grid grid-cols-1 md:grid-cols-2 gap-6" >
152+ {
153+ content .usage .listItems .map ((item ) => (
154+ <div class = " text-content-active bg-primary-inverse rounded-xl px-8 pt-8 pb-4 shadow-md" >
155+ <div class = " flex items-center mb-4" >
156+ <div
157+ class :list = { [" w-12 h-12 rounded-lg flex items-center justify-center mr-4" , item .background ]}
158+ >
159+ <Marker
160+ icon = { item .icon }
161+ color = { item .color }
162+ size = { content .usage .listMarkerSize }
163+ />
164+ </div >
165+ <h3 class = " text-xl font-semibold mt-0 mb-0" >{ item .title } </h3 >
166+ </div >
167+ <p class = " text-content" >
168+ { item .description }
169+ </p >
170+ </div >
171+ ))
172+ }
173+ </div >
174+ </section >
175+
176+ <section class =" mb-12" aria-labelledby =" privacy-information-sharing-title" >
177+ <h2
178+ class =" text-2xl md:text-3xl font-bold text-content-active mb-6"
179+ id =" privacy-information-sharing-title"
180+ >
181+ { content .sharing .title }
182+ </h2 >
183+ <div
184+ class =" bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-xl px-8 pt-8 pb-4"
185+ >
186+ <div class =" flex items-start" >
187+ <div class =" shrink-0" >
188+ <Marker
189+ icon =" warning"
190+ color =" text-yellow-600 dark:text-yellow-400"
191+ size ={ 8 }
192+ />
193+ </div >
194+ <div class =" text-content-active ml-4" >
195+ <h3 class =" text-xl font-semibold mb-2 mt-1.5" >{ content .sharing .subtitle } </h3 >
196+ <p class =" text-content" >{ content .sharing .description } </p >
197+ <List
198+ variant =" colored-marker-list"
199+ items ={ content .sharing .listItems }
200+ />
201+ </div >
202+ </div >
203+ </div >
204+ </section >
0 commit comments