Skip to content
570 linesCodeBlameRaw
1import { ArrowUpRight } from "lucide-react";
2
3import { type FeaturePlan, type FreeTier, MICROS_PER_DOLLAR, type Price } from "@g1t/contracts";
4
5import type { Route } from "./+types/pricing";
6import { wholeDollars } from "../lib/billing";
7import { page } from "../lib/meta";
8import { TimeAgo } from "../components/ui";
9import { billing } from "../lib/services.server";
10
11export function meta(args: Route.MetaArgs) {
12 return page(args, {
13 title: "Pricing · g1t",
14 description:
15 "The forge is free. One plan, $20 a month per workspace with $10 of usage included; usage at what it costs g1t plus 20%. No seats, ever.",
16 });
17}
18
19export async function loader() {
20 const [book, status] = await Promise.all([billing.prices().catch(() => null), billing.status().catch(() => null)]);
21 return { book, free: status?.free ?? false };
22}
23
24/** A price in dollars, with as many digits as it needs to say anything. */
25function money(micros: number): string {
26 const dollars = micros / MICROS_PER_DOLLAR;
27 if (dollars >= 1) return `$${dollars.toFixed(2)}`;
28 if (dollars >= 0.01) return `$${dollars.toFixed(3)}`;
29 return `$${dollars.toPrecision(2)}`;
30}
31
32/** Per second is easier to read per minute. */
33function perUnit(price: Price, micros: number): string {
34 return price.unit === "second" ? `${money(micros * 60)} a minute` : `${money(micros)} per ${price.unit}`;
35}
36
37function gigabytes(bytes: number): string {
38 return `${Math.round((bytes / 1e9) * 10) / 10} GB`;
39}
40
41function count(n: number): string {
42 return n.toLocaleString("en-US");
43}
44
45/** What the page says when billing cannot be reached: the published defaults. */
46const DEFAULT_FREE: Required<FreeTier> = {
47 trialWorkspaceMicros: 5_000_000,
48 trialMonthlyPoolMicros: 100_000_000,
49 ossPoolMicros: 25_000_000,
50 ossRepoMicros: 2_000_000,
51 freePrivateStorageBytes: 1_000_000_000,
52 auditRetentionDays: 7,
53 planAuditRetentionDays: 90,
54 minChargeMicros: 5_000_000,
55 gitOperationsIncluded: 50_000,
56 paidStartCeilingMicros: 100_000_000,
57 overageForgiveCostMicros: 50_000_000,
58};
59
60const DEFAULT_PLAN: FeaturePlan = {
61 feature: "plan",
62 title: "g1t",
63 monthlyCents: 2000,
64 includes: [
65 "$10 of usage each month at cost plus 20%, used first",
66 "Everyone in the workspace at one price, never per person",
67 "Unlimited projects, previews and repositories",
68 "Agents, checks, workflows, the merge queue, deployments and semantic search",
69 "Usage past $10 is charged at cost plus 20%, up to your spend limit",
70 ],
71 overage: "Everything is metered from the first unit at what it costs g1t plus 20%. Unused included usage does not roll over.",
72};
73
74/** The ways to reach g1t about an enterprise account. */
75const ENTERPRISE_MAIL = "mailto:hey@flagon.io?subject=Enterprise%20billing%20for%20g1t";
76
77const HOW = [
78 {
79 title: "Our cost, passed through",
80 body: "Every sandbox second, build, app request and model token costs g1t money at Cloudflare or a model provider. Each is metered and charged at that cost plus 20%, from the first second and the first request. Use a little, pay a little.",
81 },
82 {
83 title: "Prices follow costs, by themselves",
84 body: "Model runs are charged at what Cloudflare's AI Gateway priced each request at, so a provider's price change reaches you the same day. Every day, sandbox, build and app costs are checked against what Cloudflare billed g1t; when one moves, its price moves with it, and the change is listed below. The rest are Cloudflare's published prices, marked as such.",
85 },
86 {
87 title: "The 20% is the overhead",
88 body: "It pays for running g1t and for building and keeping up the features you use. The same 20% on everything, and nothing bundled in.",
89 },
90 {
91 title: "No seats, ever",
92 body: "Add as many people and agents as you like. A workspace pays one flat price for the plan, and for what it uses past what the plan includes.",
93 },
94];
95
96/** One row of the free-and-plan table. */
97type Row = { what: string; free: string; plan: string; note?: string };
98
99function rows(tier: Required<FreeTier>): Row[] {
100 return [
101 {
102 what: "The forge",
103 free: "Free",
104 plan: "Included",
105 note: "Public and private repositories, issues, pull requests, reviews, protected branches, code owners, search and Explore.",
106 },
107 {
108 what: "Agents, checks, workflows, merge queue",
109 free: "After a card check: the trial, and the open-source pool for checks, workflows and the merge queue on public repositories",
110 plan: "From the plan's included usage, then at cost plus 20%",
111 },
112 {
113 what: "Projects and previews",
114 free: "Not available: deployments run on g1t's machines",
115 plan: "Unlimited, and never charged for. An app no one visits costs nothing.",
116 },
117 {
118 what: "Deployments",
119 free: "Not available",
120 plan: "Builds by the second, app requests, CPU time and custom domains, each from the first at cost plus 20%",
121 },
122 {
123 what: "Semantic search",
124 free: "After a card check, from the trial",
125 plan: "From the plan's included usage, then at cost plus 20%",
126 },
127 {
128 what: "Private storage",
129 free: `${gigabytes(tier.freePrivateStorageBytes)}, never charged. Past it, pushes to private repositories stop until you make room or start the plan.`,
130 plan: `${gigabytes(tier.freePrivateStorageBytes)} free, then at cost plus 20%. Pushes never stop.`,
131 note: "Public repositories are never charged for storage.",
132 },
133 {
134 what: "Git operations",
135 free: `${count(tier.gitOperationsIncluded)} a month, never charged. Past it, slowed to 60 an hour until the month turns.`,
136 plan: `${count(tier.gitOperationsIncluded)} a month free, then at cost plus 20%. Never slowed.`,
137 note: "Clones, fetches and pushes through g1t.",
138 },
139 {
140 what: "Actions cache",
141 free: "2 GiB an entry and 10 GiB a repository, never charged",
142 plan: "The same limits, with what it stores at cost plus 20%",
143 },
144 {
145 what: "Audit log",
146 free: `${tier.auditRetentionDays} days, with export`,
147 plan: `${tier.planAuditRetentionDays} days, with export`,
148 note: "Longer by arrangement. Older entries are deleted each day.",
149 },
150 {
151 what: "Secret scanning, push protection, vulnerability alerts, security updates",
152 free: "Included",
153 plan: "Included",
154 note: "Custom patterns, validity checks, code scanning, dependency review and the security overview on private repositories are the Security and quality activation. On public repositories they are free.",
155 },
156 { what: "Single sign-on", free: "On every plan, once it is built", plan: "On every plan, once it is built" },
157 { what: "Members", free: "Unlimited", plan: "Unlimited" },
158 {
159 what: "Usage past what is included",
160 free: "Not possible: a free workspace never runs up a bill",
161 plan: "Charged at cost plus 20%, up to a spend limit you set. No quotas: only your limit stops anything.",
162 },
163 ];
164}
165
166export default function Pricing({ loaderData }: Route.ComponentProps) {
167 const { book, free } = loaderData;
168 const checked = book?.prices.map((p) => p.checkedAt).filter((at): at is string => !!at).sort().at(-1);
169 const given = Object.fromEntries(Object.entries(book?.free ?? {}).filter(([, value]) => value != null));
170 const tier: Required<FreeTier> = { ...DEFAULT_FREE, ...given };
171 const plan = book?.plans?.find((p) => p.feature === "plan") ?? DEFAULT_PLAN;
172 // The Security and quality activation, as the price book prices it.
173 const securityPlan = book?.plans?.find((p) => p.feature === "security") ?? null;
174 const price = plan.monthlyCents / 100;
175 const dollars = wholeDollars;
176 return (
177 <main className="mx-auto max-w-4xl px-4 py-12">
178 <p className="text-sm font-medium text-accent">Pricing</p>
179 <h1 className="mt-2 text-3xl font-semibold tracking-tight sm:text-4xl">One plan, and usage at cost plus 20%</h1>
180 <p className="mt-3 max-w-2xl text-muted">
181 The forge is free for everyone. Work that runs on g1t's machines is metered at what it costs g1t, plus 20%. The
182 numbers on this page are the live price book g1t charges from.
183 </p>
184 {free && (
185 <div className="mt-5 rounded-xl border border-accent/30 bg-accent/5 px-4 py-3 text-sm">
186 <span className="font-medium">Free while g1t is being built out.</span>{" "}
187 <span className="text-muted">Usage is recorded at these prices but not charged for now. The plan is charged.</span>
188 </div>
189 )}
190
191 <section className="mt-10 rounded-xl border border-accent/40 bg-surface p-6">
192 <div className="flex flex-wrap items-baseline justify-between gap-3">
193 <h2 className="text-xl font-semibold tracking-tight">{plan.title}</h2>
194 <p>
195 <span className="text-3xl font-semibold tabular-nums">${price}</span>{" "}
196 <span className="text-sm text-muted">a month per workspace</span>
197 </p>
198 </div>
199 <ul className="mt-4 space-y-1.5 text-sm text-muted">
200 {plan.includes.map((line) => (
201 <li key={line} className="flex gap-2">
202 <span aria-hidden className="text-accent">
203 ✓
204 </span>
205 {line}
206 </li>
207 ))}
208 </ul>
209 <p className="mt-3 text-xs text-faint">{plan.overage}</p>
210 <div className="mt-5 grid gap-5 border-t border-line pt-5 text-sm sm:grid-cols-2">
211 <div>
212 <p className="font-medium">Where the ${price} goes</p>
213 <p className="mt-1 text-muted">
214 $10 comes back to you as usage: agents, sandboxes, builds and deployments at cost plus 20%, used before
215 anything else. The other $10 pays for running g1t, the free forge for everyone, and the people building it.
216 </p>
217 </div>
218 <div>
219 <p className="font-medium">No quotas</p>
220 <p className="mt-1 text-muted">
221 No count of projects, previews, builds, requests or git operations ever stops a workspace on the plan. Past
222 the $10, usage is charged at cost plus 20%, and only your spend limit stops it. Unused included usage does
223 not roll over.
224 </p>
225 </div>
226 </div>
227 <p className="mt-5 text-sm text-muted">An owner starts the plan from the workspace's Billing page.</p>
228 </section>
229
230 {securityPlan && (
231 <section id="security" className="mt-6 rounded-xl border border-line bg-surface p-6">
232 <div className="flex flex-wrap items-baseline justify-between gap-3">
233 <h2 className="text-xl font-semibold tracking-tight">{securityPlan.title}</h2>
234 <p>
235 <span className="text-3xl font-semibold tabular-nums">${(securityPlan.monthlyCents / 100).toFixed(securityPlan.monthlyCents % 100 ? 2 : 0)}</span>{" "}
236 <span className="text-sm text-muted">a month per workspace</span>
237 </p>
238 </div>
239 <p className="mt-2 text-sm text-muted">
240 An activation, with or without the plan: the security suite's paid parts for a workspace's private repositories.
241 </p>
242 <ul className="mt-4 space-y-1.5 text-sm text-muted">
243 {securityPlan.includes.map((line) => (
244 <li key={line} className="flex gap-2">
245 <span aria-hidden className="text-accent">
246 ✓
247 </span>
248 {line}
249 </li>
250 ))}
251 </ul>
252 <p className="mt-3 text-xs text-faint">{securityPlan.overage}</p>
253 </section>
254 )}
255
256 <h2 className="mt-14 text-xl font-semibold tracking-tight">Free and the plan, side by side</h2>
257 <p className="mt-1 text-sm text-muted">
258 Secret scanning, push protection, vulnerability alerts and security updates are free everywhere, on every plan.
259 </p>
260 {/* On a phone, one row at a time with both answers under it; a table that wide would scroll. */}
261 <ul className="mt-4 divide-y divide-line rounded-xl border border-line text-sm sm:hidden">
262 {rows(tier).map((row) => (
263 <li key={row.what} className="px-4 py-3">
264 <p className="font-medium">{row.what}</p>
265 {row.note && <p className="text-xs text-faint">{row.note}</p>}
266 <dl className="mt-2 grid grid-cols-[4.5rem_1fr] gap-x-3 gap-y-1.5">
267 <dt className="text-xs leading-5 text-faint">Free</dt>
268 <dd className="text-muted">{row.free}</dd>
269 <dt className="text-xs leading-5 text-faint">{plan.title}</dt>
270 <dd className="text-muted">{row.plan}</dd>
271 </dl>
272 </li>
273 ))}
274 </ul>
275 <div className="mt-4 hidden overflow-x-auto rounded-xl border border-line sm:block">
276 <table className="w-full min-w-[36rem] text-left text-sm">
277 <thead className="border-b border-line text-xs text-muted">
278 <tr>
279 <th className="px-4 py-2.5 font-medium">
280 <span className="sr-only">What</span>
281 </th>
282 <th className="px-4 py-2.5 font-medium">Free</th>
283 <th className="px-4 py-2.5 font-medium">
284 {plan.title}, ${price} a month
285 </th>
286 </tr>
287 </thead>
288 <tbody className="divide-y divide-line">
289 {rows(tier).map((row) => (
290 <tr key={row.what} className="align-top">
291 <td className="px-4 py-3">
292 <p className="font-medium">{row.what}</p>
293 {row.note && <p className="text-xs text-faint">{row.note}</p>}
294 </td>
295 <td className="px-4 py-3 text-muted">{row.free}</td>
296 <td className="px-4 py-3 text-muted">{row.plan}</td>
297 </tr>
298 ))}
299 </tbody>
300 </table>
301 </div>
302 <p className="mt-3 text-sm text-muted">
303 Git operations cost g1t money too: Cloudflare charges g1t $0.15 per 1,000. {count(tier.gitOperationsIncluded)} a
304 month is far more than an active workspace uses; an agent run takes two to four.
305 </p>
306
307 <h2 className="mt-14 text-xl font-semibold tracking-tight">No card, no compute</h2>
308 <div className="mt-3 max-w-3xl space-y-3 text-sm text-muted">
309 <p>
310 Agents, checks, workflows, the merge queue, deployments and semantic search run on g1t's machines. They need
311 the plan, or a card check.
312 </p>
313 <p>
314 The reason: compute costs g1t real money from the first second, and free compute draws people who use it to
315 mine cryptocurrency. A card check is the smallest gate that stops that, with one trial per card.
316 </p>
317 <p>
318 A card check is never charged. Stripe saves and verifies the card, with 3-D Secure where your bank asks for it.
319 Nothing is charged until an owner starts the plan, and then the same card is used, without asking for it again.
320 The trial needs a credit or debit card; prepaid cards can still pay for the plan.
321 </p>
322 </div>
323
324 <div className="mt-5 grid gap-4 sm:grid-cols-2">
325 <section className="rounded-xl border border-line bg-surface p-5">
326 <h3 className="font-medium">The trial</h3>
327 <p className="mt-1.5 text-sm text-muted">
328 {dollars(tier.trialWorkspaceMicros)} of usage, once per workspace and once per card, after a card check with a credit or
329 debit card. It comes from a{" "}
330 {dollars(tier.trialMonthlyPoolMicros)} pool each month for everyone; when a month's pool is given out, new
331 trials wait until the 1st. The trial does not cover deployments and never turns into a charge. If the last
332 run on a trial goes past it, g1t covers the difference.
333 </p>
334 </section>
335 <section className="rounded-xl border border-line bg-surface p-5">
336 <h3 className="font-medium">The open-source pool</h3>
337 <p className="mt-1.5 text-sm text-muted">
338 Checks, workflows and the merge queue on public repositories, after a card check:{" "}
339 {dollars(tier.ossPoolMicros)} a month in all, up to {dollars(tier.ossRepoMicros)} a month per repository.
340 Agents do not run from the pool. When the pool or a repository's share is used up, the work waits for the
341 month to turn, or the workspace pays as usual.
342 </p>
343 </section>
344 </div>
345
346 <h2 className="mt-14 text-xl font-semibold tracking-tight">Limits, and how to raise them</h2>
347 <p className="mt-1 max-w-3xl text-sm text-muted">
348 g1t lets usage run ahead of payment only so far. Limits keep a mistake small, for you and for g1t.
349 </p>
350 <ul className="mt-4 grid gap-3 text-sm sm:grid-cols-2">
351 <li className="rounded-xl border border-line bg-surface p-4">
352 <p className="font-medium">{dollars(tier.paidStartCeilingMicros)} in the first month</p>
353 <p className="mt-1 text-muted">
354 A workspace on the plan can use up to {dollars(tier.paidStartCeilingMicros)} in its first month. After that,
355 the limit grows with payments that clear.
356 </p>
357 </li>
358 <li className="rounded-xl border border-line bg-surface p-4">
359 <p className="font-medium">Your own spend limit</p>
360 <p className="mt-1 text-muted">
361 Owners set a monthly spend limit anywhere up to the highest limit the workspace has had, with no approval.
362 Once, you can raise it yourself to twice that.
363 </p>
364 </li>
365 <li className="rounded-xl border border-line bg-surface p-4">
366 <p className="font-medium">Prepay to raise it now</p>
367 <p className="mt-1 text-muted">
368 Prepaying from $25 raises what you can use by the same amount, at once. From $1,000 you can also pay by bank
369 transfer.
370 </p>
371 </li>
372 <li className="rounded-xl border border-line bg-surface p-4">
373 <p className="font-medium">Raise my limit</p>
374 <p className="mt-1 text-muted">
375 Need more? Ask from Billing with the amount, why, and what you expect to spend. You get an answer within one
376 business day, in the app and by email.
377 </p>
378 </li>
379 </ul>
380
381 <h2 className="mt-14 text-xl font-semibold tracking-tight">When usage runs high</h2>
382 <ul className="mt-4 grid gap-3 text-sm sm:grid-cols-2">
383 <li className="rounded-xl border border-line bg-surface p-4">
384 <p className="font-medium">A spike pauses new work</p>
385 <p className="mt-1 text-muted">
386 When an hour's spend is five times your usual hour, and at least $5, new compute waits for an owner to choose
387 Keep going or Stop. Runs already going finish.
388 </p>
389 </li>
390 <li className="rounded-xl border border-line bg-surface p-4">
391 <p className="font-medium">Caps per run and per issue</p>
392 <p className="mt-1 text-muted">
393 One agent run stops at $2 and the agents on one issue at $10 in all, so a run stuck in a loop stops on its own.
394 Owners change both on Billing.
395 </p>
396 </li>
397 <li className="rounded-xl border border-line bg-surface p-4">
398 <p className="font-medium">Alerts at 50, 75, 90 and 100%</p>
399 <p className="mt-1 text-muted">
400 Of the plan's included usage, your spend limit and g1t's limit: in the app and by email.
401 </p>
402 </li>
403 <li className="rounded-xl border border-line bg-surface p-4">
404 <p className="font-medium">Spent more than you meant to? Tell us</p>
405 <p className="mt-1 text-muted">
406 Tell us from Billing what happened. Once in 12 months, g1t can credit back usage you did not mean, always
407 including its 20% on it. Larger credits, or a second one within 12 months, are reviewed by a person.
408 </p>
409 </li>
410 </ul>
411 <p className="mt-3 text-sm text-muted">
412 No card is charged less than {dollars(tier.minChargeMicros)} when a month closes, so a payment's fee is never most
413 of it. Smaller amounts carry over to the next invoice. Charges at a limit always go through.
414 </p>
415
416 <div className="mt-14 grid gap-4 sm:grid-cols-2">
417 {HOW.map((item) => (
418 <section key={item.title} className="rounded-xl border border-line bg-surface p-5">
419 <h2 className="font-medium">{item.title}</h2>
420 <p className="mt-1.5 text-sm text-muted">{item.body}</p>
421 </section>
422 ))}
423 </div>
424
425 <h2 className="mt-14 text-xl font-semibold tracking-tight">Usage</h2>
426 <p className="mt-1 text-sm text-muted">
427 {checked ? (
428 <>
429 Last checked against Cloudflare's bill <TimeAgo at={checked} />.
430 </>
431 ) : (
432 "Starting from Cloudflare's published prices; checked against its bill daily."
433 )}
434 </p>
435 <div className="mt-4 overflow-x-auto rounded-xl border border-line">
436 <table className="w-full text-left text-sm sm:min-w-[36rem]">
437 <thead className="border-b border-line text-xs text-muted">
438 <tr>
439 <th className="px-4 py-2.5 font-medium">What</th>
440 <th className="px-4 py-2.5 font-medium">Costs g1t</th>
441 {/* The markup is in what you pay; on a phone the column gives way. */}
442 <th className="hidden px-4 py-2.5 font-medium sm:table-cell">Markup</th>
443 <th className="px-4 py-2.5 font-medium">You pay</th>
444 </tr>
445 </thead>
446 <tbody className="divide-y divide-line">
447 <tr>
448 <td className="px-4 py-3">
449 <p className="font-medium">Models</p>
450 <p className="text-xs text-faint">g1t's hosted models, through AI Gateway</p>
451 </td>
452 <td className="px-4 py-3 text-muted">What the provider charges, per request</td>
453 <td className="hidden px-4 py-3 tabular-nums sm:table-cell">{book?.modelMarginPercent ?? 20}%</td>
454 <td className="px-4 py-3 text-muted">Cost + {book?.modelMarginPercent ?? 20}%</td>
455 </tr>
456 <tr>
457 <td className="px-4 py-3">
458 <p className="font-medium">Projects, previews and apps</p>
459 <p className="text-xs text-faint">Having them. An app's requests and CPU time are charged below.</p>
460 </td>
461 <td className="px-4 py-3 text-muted">Next to nothing</td>
462 <td className="hidden px-4 py-3 tabular-nums sm:table-cell">—</td>
463 <td className="px-4 py-3 text-muted">Not charged</td>
464 </tr>
465 {(book?.prices ?? []).filter((price) => price.meter !== "app_month").map((price) => (
466 <tr key={price.meter}>
467 <td className="px-4 py-3">
468 <p className="font-medium">{price.title}</p>
469 <p className="text-xs text-faint">
470 {price.meter === "actions_cache" ? "On the plan only. A free workspace is never charged for it. " : ""}
471 {price.source === "cloudflare" ? "Measured from Cloudflare's bill" : "Cloudflare's published price"}
472 </p>
473 </td>
474 <td className="px-4 py-3 font-mono text-xs tabular-nums text-muted">{perUnit(price, price.costMicros)}</td>
475 <td className="hidden px-4 py-3 tabular-nums sm:table-cell">{price.markupPercent}%</td>
476 <td className="px-4 py-3 font-mono text-xs tabular-nums">{perUnit(price, price.priceMicros)}</td>
477 </tr>
478 ))}
479 </tbody>
480 </table>
481 </div>
482
483 <h2 className="mt-14 text-xl font-semibold tracking-tight">Enterprise</h2>
484 <p className="mt-1 text-sm text-muted">
485 For organizations with several workspaces: one invoice and one limit. The prices are the ones on this page.
486 </p>
487 <section className="mt-4 rounded-xl border border-line bg-surface p-5">
488 <ul className="grid gap-3 text-sm sm:grid-cols-2">
489 <li>
490 <p className="font-medium">Consolidated invoicing</p>
491 <p className="text-muted">One monthly invoice for every workspace, paid by card or bank transfer.</p>
492 </li>
493 <li>
494 <p className="font-medium">Custom terms</p>
495 <p className="text-muted">One limit across every workspace, invoice terms and a billing contact, set with you.</p>
496 </li>
497 <li>
498 <p className="font-medium">Security on every plan</p>
499 <p className="text-muted">
500 The audit log with export, {tier.planAuditRetentionDays} days or longer by arrangement, and secret push
501 protection, for every workspace.
502 </p>
503 </li>
504 <li>
505 <p className="font-medium">
506 Single sign-on <span className="ml-1 rounded bg-raised px-1.5 py-0.5 text-xs text-muted">Coming</span>
507 </p>
508 <p className="text-muted">Through your identity provider, on every plan once it is built. Not available yet.</p>
509 </li>
510 </ul>
511 <a
512 href={ENTERPRISE_MAIL}
513 className="mt-5 inline-flex items-center gap-1.5 rounded-md border border-line px-3 py-1.5 text-sm hover:border-line-strong"
514 >
515 Write to us about enterprise
516 <ArrowUpRight size={14} />
517 </a>
518 </section>
519
520 <h2 className="mt-14 text-xl font-semibold tracking-tight">Price changes</h2>
521 {book && book.changes.length > 0 ? (
522 <ul className="mt-4 divide-y divide-line rounded-xl border border-line">
523 {book.changes.map((change) => {
524 const title = book.prices.find((p) => p.meter === change.meter)?.title ?? change.meter;
525 // What you pay moved: the cost, the markup, or both.
526 const before = change.oldCostMicros * (100 + (change.oldMarkupPercent ?? change.markupPercent));
527 const after = change.newCostMicros * (100 + change.markupPercent);
528 const up = after > before;
529 const fresh = after === before || before === 0;
530 return (
531 <li key={`${change.meter}-${change.createdAt}`} className="px-4 py-3 text-sm">
532 <p>
533 <span className="font-medium">{title}</span>{" "}
534 {fresh ? (
535 <span className="text-muted">new</span>
536 ) : (
537 <span className={up ? "text-warn" : "text-accent"}>
538 {up ? "up" : "down"} {Math.abs((after / before - 1) * 100).toFixed(1)}%
539 </span>
540 )}
541 </p>
542 <p className="mt-0.5 text-xs text-faint">
543 {change.effectiveAt ? (
544 <>
545 {change.reason} · <span className="text-fg-soft">takes effect {change.effectiveAt.slice(0, 10)}</span>
546 </>
547 ) : (
548 <>
549 {change.reason} · <TimeAgo at={change.createdAt} />
550 </>
551 )}
552 </p>
553 </li>
554 );
555 })}
556 </ul>
557 ) : (
558 <p className="mt-2 text-sm text-muted">None yet. When a price moves, it is listed here with why.</p>
559 )}
560
561 <a
562 href="https://docs.g1t.sh/guides/usage-and-billing/"
563 className="mt-12 inline-flex items-center gap-1.5 text-sm text-accent hover:underline"
564 >
565 How usage and billing work
566 <ArrowUpRight size={14} />
567 </a>
568 </main>
569 );
570}