refactor(web): remove unnecessary "use client" from 6 pure-render components
BenchResourceCard, MobileProjectCard, MobileCapacityCard, DynamicFieldRenderer, BudgetStatusBar, and TimelineHeader use no hooks, event handlers, or browser APIs — they can be server components, reducing client bundle size. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
"use client";
|
||||
|
||||
import { clsx } from "clsx";
|
||||
import { formatDateLong } from "~/lib/format.js";
|
||||
import { FieldType } from "@capakraken/shared";
|
||||
@@ -36,9 +34,7 @@ function renderValue(fieldDef: BlueprintFieldDefinition, value: unknown): React.
|
||||
<span
|
||||
className={clsx(
|
||||
"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",
|
||||
bool
|
||||
? "bg-green-100 text-green-700"
|
||||
: "bg-gray-100 text-gray-500",
|
||||
bool ? "bg-green-100 text-green-700" : "bg-gray-100 text-gray-500",
|
||||
)}
|
||||
>
|
||||
{bool ? "Yes" : "No"}
|
||||
@@ -100,9 +96,7 @@ function FieldRow({ fieldDef, value }: { fieldDef: BlueprintFieldDefinition; val
|
||||
{fieldDef.label}
|
||||
</dt>
|
||||
<dd className="text-sm">{renderValue(fieldDef, value)}</dd>
|
||||
{fieldDef.description && (
|
||||
<p className="text-xs text-gray-400">{fieldDef.description}</p>
|
||||
)}
|
||||
{fieldDef.description && <p className="text-xs text-gray-400">{fieldDef.description}</p>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user