mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-30 06:20:24 +00:00
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
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 11m8s
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user