● Zion Boggan
repos/Docket/app/laws/page.tsx
zionboggan.com ↗
179 lines · tsx
History for this file →
1
import type { Metadata } from "next";
2
import Link from "next/link";
3
import { Suspense } from "react";
4
import { getPublicLawsCount, getPrivateLawsCount } from "@/lib/feed";
5
import { ordinal } from "@/lib/format";
6
import { CiteThis } from "@/components/cite-this";
7
import { LawsBrowser } from "@/components/laws-browser";
8
 
9
export const revalidate = 300;
10
 
11
export const metadata: Metadata = {
12
  title: "Laws",
13
  description:
14
    "Enacted Public Laws of the United States. Each law links to the bill it came from and the official record.",
15
};
16
 
17
export default function LawsPage() {
18
  const publicCount = getPublicLawsCount();
19
  const privateCount = getPrivateLawsCount();
20
 
21
  return (
22
    <div
23
      className="mx-auto w-full max-w-[860px] px-6 sm:px-8"
24
      style={{
25
        paddingTop: "clamp(32px, 6vw, 56px)",
26
        paddingBottom: "clamp(48px, 8vw, 80px)",
27
      }}
28
    >
29
      {}
30
      <nav aria-label="Breadcrumb" className="mb-10">
31
        <ol className="flex flex-wrap items-center gap-2" style={{ marginBottom: "12px" }}>
32
          <li>
33
            <Link
34
              href="/"
35
              className="focus-ring label no-underline hover:underline"
36
              style={{ color: "var(--dk-signal)", fontSize: "12px", letterSpacing: "0.12em" }}
37
            >
38
              Home
39
            </Link>
40
          </li>
41
          <li aria-hidden="true" className="label" style={{ color: "var(--dk-ash-2)", fontSize: "12px" }}>
42
            /
43
          </li>
44
          <li
45
            className="label"
46
            style={{ color: "var(--dk-ash)", fontSize: "12px", letterSpacing: "0.12em" }}
47
            aria-current="page"
48
          >
49
            Laws
50
          </li>
51
        </ol>
52
        <Link
53
          href="/bills"
54
          className="focus-ring tap no-underline hover:underline"
55
          style={{
56
            display: "inline-flex",
57
            alignItems: "center",
58
            gap: "8px",
59
            fontFamily: "var(--font-mono), ui-monospace, monospace",
60
            fontSize: "13px",
61
            letterSpacing: "0.08em",
62
            color: "var(--dk-signal)",
63
          }}
64
        >
65
          ← All bills
66
        </Link>
67
      </nav>
68
 
69
      {}
70
      <header
71
        style={{
72
          borderBottom: "1px solid var(--dk-line)",
73
          paddingBottom: "clamp(28px, 5vw, 48px)",
74
          marginBottom: "clamp(28px, 5vw, 48px)",
75
        }}
76
      >
77
        <p
78
          className="label"
79
          style={{
80
            color: "var(--dk-signal)",
81
            marginBottom: "20px",
82
            display: "flex",
83
            alignItems: "center",
84
            gap: "8px",
85
            fontSize: "12px",
86
            letterSpacing: "0.14em",
87
          }}
88
        >
89
          <span
90
            aria-hidden="true"
91
            style={{
92
              width: "5px",
93
              height: "5px",
94
              borderRadius: "50%",
95
              background: "var(--dk-signal)",
96
              display: "inline-block",
97
              flexShrink: 0,
98
            }}
99
          />
100
          Enacted
101
        </p>
102
        <h1
103
          className="font-display text-paper"
104
          style={{
105
            fontSize: "clamp(2.2rem, 7vw, 3.75rem)",
106
            fontWeight: 900,
107
            lineHeight: 1.0,
108
            letterSpacing: "-0.01em",
109
            wordSpacing: "0.06em",
110
            textTransform: "uppercase",
111
            maxWidth: "18ch",
112
            marginBottom: "24px",
113
          }}
114
        >
115
          Public Laws
116
        </h1>
117
        <p
118
          className="font-prose"
119
          style={{
120
            fontStyle: "italic",
121
            fontSize: "clamp(1rem, 1.8vw, 1.125rem)",
122
            lineHeight: 1.55,
123
            color: "var(--dk-ash)",
124
            maxWidth: "56ch",
125
          }}
126
        >
127
          A Public Law is a bill that has been enacted. Once enacted, it becomes a
128
          fixed part of the record. This list grows as more bills become law -
129
          currently {publicCount.toLocaleString()} from the {ordinal(119)} Congress
130
          {privateCount > 0
131
            ? `, alongside ${privateCount.toLocaleString()} Private Law${privateCount === 1 ? "" : "s"} (which apply to specific individuals or entities).`
132
            : "."}
133
        </p>
134
      </header>
135
 
136
      <Suspense fallback={<LawsSkeleton />}>
137
        <LawsBrowser />
138
      </Suspense>
139
 
140
      {}
141
      <div
142
        style={{
143
          marginTop: "clamp(40px, 7vw, 72px)",
144
          borderTop: "1px solid var(--dk-line)",
145
          paddingTop: "clamp(24px, 4vw, 40px)",
146
        }}
147
      >
148
        <p className="label mb-8" style={{ color: "var(--dk-ash-2)" }}>
149
          Public Laws are identified by their status on congress.gov. Order is by
150
          law number -no editorial weighting. No comment surface appears here, by
151
          policy.
152
        </p>
153
        <p className="label mb-4" style={{ color: "var(--dk-ash)" }}>
154
          Cite this page
155
        </p>
156
        <CiteThis
157
          kind="page"
158
          title="Laws -Enacted Public Laws"
159
          permalink="https://usdocket.org/laws"
160
          sourceUrl="https://www.congress.gov/public-laws/119th-congress"
161
        />
162
      </div>
163
    </div>
164
  );
165
}
166
 
167
function LawsSkeleton() {
168
  return (
169
    <div className="mt-8">
170
      <div className="h-14 w-full animate-pulse rounded-sm bg-graphite" />
171
      <div className="mt-8 mb-4 h-4 w-40 animate-pulse rounded-sm bg-graphite" />
172
      <div className="space-y-3">
173
        {Array.from({ length: 12 }).map((_, i) => (
174
          <div key={i} className="h-28 w-full animate-pulse rounded-sm bg-graphite" />
175
        ))}
176
      </div>
177
    </div>
178
  );
179
}