feat: enhance testing and admin page functionality
- Mocked `useRouter` from `next/navigation` in tests to improve routing behavior during testing. - Updated admin page tests to reflect changes in title display and removed unnecessary back link check. - Refactored admin page header to improve accessibility and layout, displaying month and year more clearly. - Removed unused imports and components to streamline code and enhance maintainability.
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
|
||||
"use client";
|
||||
|
||||
import type { ReactNode } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useTranslation } from "@/i18n/use-translation";
|
||||
import { cn } from "@/lib/utils";
|
||||
@@ -21,8 +20,6 @@ export interface CalendarHeaderProps {
|
||||
disabled?: boolean;
|
||||
onPrevMonth: () => void;
|
||||
onNextMonth: () => void;
|
||||
/** Optional content shown above the nav row (e.g. Admin link). */
|
||||
trailingContent?: ReactNode;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
@@ -31,7 +28,6 @@ export function CalendarHeader({
|
||||
disabled = false,
|
||||
onPrevMonth,
|
||||
onNextMonth,
|
||||
trailingContent,
|
||||
className,
|
||||
}: CalendarHeaderProps) {
|
||||
const { t, monthName, weekdayLabels } = useTranslation();
|
||||
@@ -41,9 +37,6 @@ export function CalendarHeader({
|
||||
|
||||
return (
|
||||
<header className={cn("flex flex-col", className)}>
|
||||
{trailingContent != null && (
|
||||
<div className="flex justify-end mb-1 min-h-[1.5rem]">{trailingContent}</div>
|
||||
)}
|
||||
<div className="flex items-center justify-between mb-3">
|
||||
<Button
|
||||
type="button"
|
||||
|
||||
Reference in New Issue
Block a user