|
1 | | -import { ConsentPreferencesLink } from '@/app/_shell/consent/consent-preferences-link' |
2 | | -import { type LegalPageConfig, ProseLink } from '@/app/(landing)/components/prose-page' |
| 1 | +import type { ReactNode } from 'react' |
| 2 | +import { |
| 3 | + type LegalBlock, |
| 4 | + type LegalPageConfig, |
| 5 | + ProseLink, |
| 6 | +} from '@/app/(landing)/components/prose-page' |
| 7 | +import { PROSE_TABLE_WIDTHS } from '@/app/(landing)/components/prose-page/constants' |
| 8 | +import { ConsentPreferencesLink } from '@/app/(landing)/cookie-policy/consent-preferences-link' |
3 | 9 |
|
4 | | -/** Shared column widths so the three cookie tables read as one aligned grid. */ |
5 | | -const COOKIE_TABLE_WIDTHS = ['w-[24%]', 'w-[16%]', 'w-[45%]', 'w-[15%]'] |
6 | | - |
7 | | -/** The cookie-name column reads as code. */ |
8 | | -const COOKIE_TABLE_CODE_COLUMNS = [0] |
| 10 | +/** |
| 11 | + * One cookie-inventory table per consent category. The three share a header and |
| 12 | + * a column layout, so they are built from one shape rather than repeated. |
| 13 | + */ |
| 14 | +function cookieTable(caption: string, rows: ReactNode[][]): LegalBlock { |
| 15 | + return { |
| 16 | + kind: 'table', |
| 17 | + caption, |
| 18 | + columns: ['Cookie', 'Provider', 'Purpose', 'Retention'], |
| 19 | + columnWidths: [...PROSE_TABLE_WIDTHS.cookieInventory], |
| 20 | + codeColumns: [0], |
| 21 | + rows, |
| 22 | + } |
| 23 | +} |
9 | 24 |
|
10 | 25 | /** |
11 | 26 | * Cookie Policy content — the inventory a consent banner has to stand on, |
@@ -112,105 +127,69 @@ export const COOKIE_POLICY_CONFIG: LegalPageConfig = { |
112 | 127 | kind: 'paragraph', |
113 | 128 | content: `Retention periods are the maximum lifetime set when the cookie is written; a cookie can be cleared sooner at any time. Third-party providers occasionally rename or re-scope their cookies, so treat the provider column as the authoritative reference for anything not set by Sim.`, |
114 | 129 | }, |
115 | | - { |
116 | | - kind: 'table', |
117 | | - caption: 'Necessary', |
118 | | - columns: ['Cookie', 'Provider', 'Purpose', 'Retention'], |
119 | | - columnWidths: COOKIE_TABLE_WIDTHS, |
120 | | - codeColumns: COOKIE_TABLE_CODE_COLUMNS, |
121 | | - rows: [ |
122 | | - [ |
123 | | - 'better-auth.session_token', |
124 | | - 'Sim', |
125 | | - 'Keeps you signed in and identifies your session.', |
126 | | - '30 days', |
127 | | - ], |
128 | | - [ |
129 | | - 'better-auth.session_data', |
130 | | - 'Sim', |
131 | | - 'Short-lived signed cache of your session so each page load does not re-read the database.', |
132 | | - '5 minutes', |
133 | | - ], |
134 | | - [ |
135 | | - 'c15t', |
136 | | - 'Sim (via c15t)', |
137 | | - 'Records the cookie choice you made so the banner is not shown again.', |
138 | | - '365 days', |
139 | | - ], |
140 | | - [ |
141 | | - 'sidebar_collapsed', |
142 | | - 'Sim', |
143 | | - 'Remembers whether the workspace sidebar is collapsed, so the layout does not jump on load.', |
144 | | - '1 year', |
145 | | - ], |
146 | | - [ |
147 | | - '__cf_bm', |
148 | | - 'Cloudflare', |
149 | | - 'Bot-management check on requests to providers we load, such as HubSpot and X.', |
150 | | - '30 minutes', |
151 | | - ], |
| 130 | + cookieTable('Necessary', [ |
| 131 | + [ |
| 132 | + 'better-auth.session_token', |
| 133 | + 'Sim', |
| 134 | + 'Keeps you signed in and identifies your session.', |
| 135 | + '30 days', |
152 | 136 | ], |
153 | | - }, |
154 | | - { |
155 | | - kind: 'table', |
156 | | - caption: 'Analytics', |
157 | | - columns: ['Cookie', 'Provider', 'Purpose', 'Retention'], |
158 | | - columnWidths: COOKIE_TABLE_WIDTHS, |
159 | | - codeColumns: COOKIE_TABLE_CODE_COLUMNS, |
160 | | - rows: [ |
161 | | - ['_ga', 'Google Analytics', 'Distinguishes one visitor from another.', '13 months'], |
162 | | - [ |
163 | | - '_ga_*', |
164 | | - 'Google Analytics', |
165 | | - 'Holds the session state for a specific Analytics property.', |
166 | | - '13 months', |
167 | | - ], |
168 | | - [ |
169 | | - '__hstc', |
170 | | - 'HubSpot', |
171 | | - 'Tracks visits across sessions for the main tracker.', |
172 | | - '6 months', |
173 | | - ], |
174 | | - ['hubspotutk', 'HubSpot', 'Identifies a visitor across form submissions.', '6 months'], |
175 | | - ['__hssc', 'HubSpot', 'Tracks the current session.', '30 minutes'], |
176 | | - [ |
177 | | - '__hssrc', |
178 | | - 'HubSpot', |
179 | | - 'Detects whether the visitor restarted their browser.', |
180 | | - 'Session', |
181 | | - ], |
| 137 | + [ |
| 138 | + 'better-auth.session_data', |
| 139 | + 'Sim', |
| 140 | + 'Short-lived signed cache of your session so each page load does not re-read the database.', |
| 141 | + '5 minutes', |
182 | 142 | ], |
183 | | - }, |
184 | | - { |
185 | | - kind: 'table', |
186 | | - caption: 'Marketing', |
187 | | - columns: ['Cookie', 'Provider', 'Purpose', 'Retention'], |
188 | | - columnWidths: COOKIE_TABLE_WIDTHS, |
189 | | - codeColumns: COOKIE_TABLE_CODE_COLUMNS, |
190 | | - rows: [ |
191 | | - [ |
192 | | - 'guest_id', |
193 | | - 'X (Twitter)', |
194 | | - 'Identifies a browser to the X conversion pixel.', |
195 | | - '13 months', |
196 | | - ], |
197 | | - [ |
198 | | - 'guest_id_ads', |
199 | | - 'X (Twitter)', |
200 | | - 'Measures conversions from X advertising.', |
201 | | - '13 months', |
202 | | - ], |
203 | | - [ |
204 | | - 'guest_id_marketing', |
205 | | - 'X (Twitter)', |
206 | | - 'Measures the performance of X marketing campaigns.', |
207 | | - '13 months', |
208 | | - ], |
209 | | - ['personalization_id', 'X (Twitter)', 'Personalizes the ads shown on X.', '13 months'], |
210 | | - ['muc_ads', 'X (Twitter)', 'Measures ad conversions across X domains.', '13 months'], |
211 | | - ['_gcl_*', 'Google Ads', 'Attributes a sign-up to the ad that led to it.', '90 days'], |
| 143 | + [ |
| 144 | + 'c15t', |
| 145 | + 'Sim (via c15t)', |
| 146 | + 'Records the cookie choice you made so the banner is not shown again.', |
| 147 | + '365 days', |
212 | 148 | ], |
213 | | - }, |
| 149 | + [ |
| 150 | + 'sidebar_collapsed', |
| 151 | + 'Sim', |
| 152 | + 'Remembers whether the workspace sidebar is collapsed, so the layout does not jump on load.', |
| 153 | + '1 year', |
| 154 | + ], |
| 155 | + [ |
| 156 | + '__cf_bm', |
| 157 | + 'Cloudflare', |
| 158 | + 'Bot-management check on requests to providers we load, such as HubSpot and X.', |
| 159 | + '30 minutes', |
| 160 | + ], |
| 161 | + ]), |
| 162 | + cookieTable('Analytics', [ |
| 163 | + ['_ga', 'Google Analytics', 'Distinguishes one visitor from another.', '13 months'], |
| 164 | + [ |
| 165 | + '_ga_*', |
| 166 | + 'Google Analytics', |
| 167 | + 'Holds the session state for a specific Analytics property.', |
| 168 | + '13 months', |
| 169 | + ], |
| 170 | + ['__hstc', 'HubSpot', 'Tracks visits across sessions for the main tracker.', '6 months'], |
| 171 | + ['hubspotutk', 'HubSpot', 'Identifies a visitor across form submissions.', '6 months'], |
| 172 | + ['__hssc', 'HubSpot', 'Tracks the current session.', '30 minutes'], |
| 173 | + ['__hssrc', 'HubSpot', 'Detects whether the visitor restarted their browser.', 'Session'], |
| 174 | + ]), |
| 175 | + cookieTable('Marketing', [ |
| 176 | + [ |
| 177 | + 'guest_id', |
| 178 | + 'X (Twitter)', |
| 179 | + 'Identifies a browser to the X conversion pixel.', |
| 180 | + '13 months', |
| 181 | + ], |
| 182 | + ['guest_id_ads', 'X (Twitter)', 'Measures conversions from X advertising.', '13 months'], |
| 183 | + [ |
| 184 | + 'guest_id_marketing', |
| 185 | + 'X (Twitter)', |
| 186 | + 'Measures the performance of X marketing campaigns.', |
| 187 | + '13 months', |
| 188 | + ], |
| 189 | + ['personalization_id', 'X (Twitter)', 'Personalizes the ads shown on X.', '13 months'], |
| 190 | + ['muc_ads', 'X (Twitter)', 'Measures ad conversions across X domains.', '13 months'], |
| 191 | + ['_gcl_*', 'Google Ads', 'Attributes a sign-up to the ad that led to it.', '90 days'], |
| 192 | + ]), |
214 | 193 | ], |
215 | 194 | }, |
216 | 195 | { |
|
0 commit comments