add admin checks for admin pages and run biome formating 🔨
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 11m8s

This commit is contained in:
2025-07-25 13:31:12 +05:00
parent aedf7cdf7d
commit 9b2f2c1528
127 changed files with 6577 additions and 6334 deletions

View File

@ -20,7 +20,6 @@ import type { UserProfile } from "@/lib/types/user";
import { cn } from "@/lib/utils";
import { Textarea } from "../ui/textarea";
export type RejectUserFormState = {
message: string;
fieldErrors?: {
@ -37,7 +36,10 @@ export const initialState: RejectUserFormState = {
export default function UserRejectDialog({ user }: { user: UserProfile }) {
const [open, setOpen] = useState(false);
const [state, formAction, isPending] = useActionState(rejectUser, initialState);
const [state, formAction, isPending] = useActionState(
rejectUser,
initialState,
);
useEffect(() => {
if (state.message && state !== initialState) {
@ -52,7 +54,6 @@ export default function UserRejectDialog({ user }: { user: UserProfile }) {
}
}, [state]);
return (
<Dialog open={open} onOpenChange={setOpen}>
<DialogTrigger asChild>
@ -87,7 +88,10 @@ export default function UserRejectDialog({ user }: { user: UserProfile }) {
<div className="grid gap-4 py-4">
<div className="flex flex-col items-start gap-2">
<input type="hidden" name="userId" value={user.id} />
<Label htmlFor="reason" className="text-right text-muted-foreground">
<Label
htmlFor="reason"
className="text-right text-muted-foreground"
>
Rejection details
</Label>
<Textarea