style: format code with prettier
Local Build and Deploy / deploy (push) Successful in 49s

This commit is contained in:
openhands committed 2026-07-12 21:07:34 +02:00
1 parent e85e4d74ea
commit 2e4ed76121
378 files changed
+22404 -20686

No files matched your search

+27 -27
View File
@@ -1,43 +1,43 @@
'use client'
"use client";
import { Plus } from 'lucide-react'
import { useState } from 'react'
import { addEventWinner } from '@/actions/events'
import { Button } from '@/components/ui/button'
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
import { Input } from '@/components/ui/input'
import { Label } from '@/components/ui/label'
import { useServerAction } from '@/hooks/use-server-action'
import { Plus } from "lucide-react";
import { useState } from "react";
import { addEventWinner } from "@/actions/events";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { useServerAction } from "@/hooks/use-server-action";
interface Winner {
id: number
userId: number
position: number
username: string
createdAt: Date
id: number;
userId: number;
position: number;
username: string;
createdAt: Date;
}
interface Props {
eventId: number
winners: Winner[]
eventId: number;
winners: Winner[];
}
export function EventWinnersManager({ eventId, winners }: Props) {
const { run, isPending } = useServerAction()
const [showForm, setShowForm] = useState(false)
const [userId, setUserId] = useState('')
const [position, setPosition] = useState(winners.length + 1)
const { run, isPending } = useServerAction();
const [showForm, setShowForm] = useState(false);
const [userId, setUserId] = useState("");
const [position, setPosition] = useState(winners.length + 1);
function handleAdd(e: React.FormEvent) {
e.preventDefault()
e.preventDefault();
run(() => addEventWinner({ eventId, userId: Number(userId), position }), {
successMessage: 'Winner added!',
successMessage: "Winner added!",
onSuccess: () => {
setShowForm(false)
setUserId('')
setPosition(position + 1)
setShowForm(false);
setUserId("");
setPosition(position + 1);
},
})
});
}
return (
@@ -95,5 +95,5 @@ export function EventWinnersManager({ eventId, winners }: Props) {
</div>
</CardContent>
</Card>
)
);
}