feat: implement admin panel functionality in Mini App
- Added new API endpoints for admin features: `GET /api/admin/me`, `GET /api/admin/users`, and `PATCH /api/admin/duties/:id` to manage user duties. - Introduced `UserForAdmin` and `AdminDutyReassignBody` schemas for handling admin-related data. - Updated documentation to include Mini App design guidelines and admin panel functionalities. - Enhanced tests for admin API to ensure proper access control and functionality. - Improved error handling and localization for admin actions.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
"use client";
|
||||
|
||||
import type { ReactNode } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useTranslation } from "@/i18n/use-translation";
|
||||
import { cn } from "@/lib/utils";
|
||||
@@ -20,6 +21,8 @@ export interface CalendarHeaderProps {
|
||||
disabled?: boolean;
|
||||
onPrevMonth: () => void;
|
||||
onNextMonth: () => void;
|
||||
/** Optional content shown above the nav row (e.g. Admin link). */
|
||||
trailingContent?: ReactNode;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
@@ -28,6 +31,7 @@ export function CalendarHeader({
|
||||
disabled = false,
|
||||
onPrevMonth,
|
||||
onNextMonth,
|
||||
trailingContent,
|
||||
className,
|
||||
}: CalendarHeaderProps) {
|
||||
const { t, monthName, weekdayLabels } = useTranslation();
|
||||
@@ -37,6 +41,9 @@ 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