Previously notes were hidden when a cell held 2-3 records (a density choice). Show each record's note regardless of count — drop the now-unused showNote prop on PlanRangeChips. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import { ResolvedCell, cellProjectLabel } from "../lib/queries/plan";
|
|
import type { Project } from "../lib/queries/projects";
|
|
|
|
interface Props {
|
|
cell: ResolvedCell | null;
|
|
project: Project | null;
|
|
readonly?: boolean;
|
|
categoryLabel: string;
|
|
}
|
|
|
|
export default function PlanRangeChips({
|
|
cell,
|
|
project,
|
|
readonly,
|
|
categoryLabel,
|
|
}: Props) {
|
|
void readonly;
|
|
if (!cell) return null;
|
|
// Prefer the server-embedded project label (always present). Fall back to
|
|
// the looked-up `project` prop only if the cell predates the embed (stale
|
|
// cache).
|
|
const fallbackLabel = project
|
|
? project.project_number
|
|
? `${project.project_number} — ${project.name}`
|
|
: project.name
|
|
: null;
|
|
const projectLabel = cellProjectLabel(cell) ?? fallbackLabel;
|
|
const projectTitle = projectLabel ?? undefined;
|
|
return (
|
|
<div className="plan-chip-block">
|
|
<div className="plan-chip-line">
|
|
<span className="plan-chip">{categoryLabel}</span>
|
|
{projectLabel && (
|
|
<span className="plan-chip-project" title={projectTitle}>
|
|
{projectLabel}
|
|
</span>
|
|
)}
|
|
</div>
|
|
{cell.note && <div className="plan-cell-note">{cell.note}</div>}
|
|
</div>
|
|
);
|
|
}
|