Some checks failed
build-images / web (push) Has been cancelled
vision2026-ci / Python SDK resource tests (push) Has been cancelled
build-images / api (push) Has been cancelled
build-images / worker-gpu (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Has been cancelled
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Has been cancelled
codeql / Analyze (javascript-typescript) (push) Has been cancelled
codeql / Analyze (python) (push) Has been cancelled
perf / API hot-path micro-smoke (budgeted) (push) Has been cancelled
perf / Desktop engine crates (release build check) (push) Has been cancelled
vision2026-ci / API phase modules (ruff + pytest) (push) Has been cancelled
vision2026-ci / Alembic upgrade + drift check (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Has been cancelled
Paid, hosted product at menivor.com, now retired as a company project. Fresh squashed history of the cleaned working tree (secret-scanned, no .env, no customer data, no outreach logs). Built on MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
69 lines
2.0 KiB
TypeScript
69 lines
2.0 KiB
TypeScript
"use client";
|
|
|
|
import * as React from "react";
|
|
import type { CalendarEntry } from "@/lib/calendar";
|
|
import { Card } from "@/components/ui/card";
|
|
import {
|
|
WEEKDAY_LABELS,
|
|
type CalendarDay,
|
|
type CalendarView,
|
|
} from "@/components/calendar/calendar-month";
|
|
import { CalendarDayCell } from "@/components/calendar/CalendarDayCell";
|
|
|
|
export interface CalendarGridProps {
|
|
view: CalendarView;
|
|
days: readonly CalendarDay[];
|
|
buckets: Map<string, CalendarEntry[]>;
|
|
onSelect: (entry: CalendarEntry) => void;
|
|
/** Id of the entry currently being moved by drag-drop, if any. */
|
|
movingId?: string | null;
|
|
/** Drag a reschedulable entry onto another day to move it; omit to disable drag-drop. */
|
|
onDropOnDay?: (id: string, day: Date) => void;
|
|
}
|
|
|
|
const EMPTY: readonly CalendarEntry[] = [];
|
|
|
|
/**
|
|
* The month/week grid: a Sunday-first weekday header over a 7-column grid of
|
|
* {@link CalendarDayCell}s. Presentational only — day cells and entry buckets
|
|
* are computed upstream by {@link useCalendar}. Supports native HTML5
|
|
* drag-and-drop (via {@link CalendarDayCell}) when `onDropOnDay` is provided.
|
|
*/
|
|
export function CalendarGrid({
|
|
view,
|
|
days,
|
|
buckets,
|
|
onSelect,
|
|
movingId = null,
|
|
onDropOnDay,
|
|
}: Readonly<CalendarGridProps>) {
|
|
return (
|
|
<Card className="overflow-hidden">
|
|
<div className="grid grid-cols-7 border-b border-border bg-muted/40">
|
|
{WEEKDAY_LABELS.map((label) => (
|
|
<div
|
|
key={label}
|
|
className="border-r border-border px-2 py-2 text-center text-xs font-medium uppercase tracking-wide text-muted-foreground last:border-r-0"
|
|
>
|
|
{label}
|
|
</div>
|
|
))}
|
|
</div>
|
|
|
|
<div className="grid grid-cols-7 [&>*:nth-child(7n)]:border-r-0">
|
|
{days.map((day) => (
|
|
<CalendarDayCell
|
|
key={day.key}
|
|
day={day}
|
|
view={view}
|
|
entries={buckets.get(day.key) ?? EMPTY}
|
|
onSelect={onSelect}
|
|
movingId={movingId}
|
|
onDropOnDay={onDropOnDay}
|
|
/>
|
|
))}
|
|
</div>
|
|
</Card>
|
|
);
|
|
}
|