feat: initial project scaffold with CI/CD and Docker deployment
Next.js 15 + Tailwind CSS v4 week calendar showing Six Flags park hours. Scrapes the internal CloudFront API, stores results in SQLite. Includes Dockerfile (Debian/Playwright-compatible), docker-compose, and Gitea Actions pipeline that builds and pushes to the container registry. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
55
components/MonthNav.tsx
Normal file
55
components/MonthNav.tsx
Normal file
@@ -0,0 +1,55 @@
|
||||
"use client";
|
||||
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
interface MonthNavProps {
|
||||
currentYear: number;
|
||||
currentMonth: number;
|
||||
}
|
||||
|
||||
const MONTH_NAMES = [
|
||||
"January", "February", "March", "April", "May", "June",
|
||||
"July", "August", "September", "October", "November", "December",
|
||||
];
|
||||
|
||||
function addMonths(year: number, month: number, delta: number) {
|
||||
const d = new Date(year, month - 1 + delta, 1);
|
||||
return { year: d.getFullYear(), month: d.getMonth() + 1 };
|
||||
}
|
||||
|
||||
function formatParam(year: number, month: number) {
|
||||
return `${year}-${String(month).padStart(2, "0")}`;
|
||||
}
|
||||
|
||||
export function MonthNav({ currentYear, currentMonth }: MonthNavProps) {
|
||||
const router = useRouter();
|
||||
|
||||
function navigate(delta: -1 | 1) {
|
||||
const { year, month } = addMonths(currentYear, currentMonth, delta);
|
||||
router.push(`/?month=${formatParam(year, month)}`);
|
||||
}
|
||||
|
||||
const btnStyle = {
|
||||
backgroundColor: "var(--color-surface)",
|
||||
border: "1px solid var(--color-border)",
|
||||
color: "var(--color-text-muted)",
|
||||
padding: "4px 12px",
|
||||
borderRadius: "6px",
|
||||
cursor: "pointer",
|
||||
fontSize: "1rem",
|
||||
};
|
||||
|
||||
return (
|
||||
<div style={{ display: "flex", alignItems: "center", gap: "16px" }}>
|
||||
<button onClick={() => navigate(-1)} style={btnStyle} aria-label="Previous month">
|
||||
←
|
||||
</button>
|
||||
<h1 style={{ fontSize: "1.25rem", fontWeight: 600, color: "var(--color-text)", margin: 0 }}>
|
||||
{MONTH_NAMES[currentMonth - 1]} {currentYear}
|
||||
</h1>
|
||||
<button onClick={() => navigate(1)} style={btnStyle} aria-label="Next month">
|
||||
→
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user