Fixed type bugs in Reports form

This commit is contained in:
PxlLoewe
2025-07-27 15:02:14 -07:00
parent 7fc8749676
commit 25f56026fc
3 changed files with 14 additions and 20 deletions

View File

@@ -5,7 +5,6 @@ import { useForm } from "react-hook-form";
import { KEYWORD_CATEGORY, Keyword } from "@repo/db";
import { FileText } from "lucide-react";
import { Input } from "../../../../_components/ui/Input";
import { useState } from "react";
import { deleteKeyword, upsertKeyword } from "../action";
import { Button } from "../../../../_components/ui/Button";
import { redirect } from "next/navigation";
@@ -17,7 +16,6 @@ export const KeywordForm = ({ keyword }: { keyword?: Keyword }) => {
resolver: zodResolver(KeywordOptionalDefaultsSchema),
defaultValues: keyword,
});
const [deleteLoading, setDeleteLoading] = useState(false);
return (
<>
<form
@@ -28,13 +26,13 @@ export const KeywordForm = ({ keyword }: { keyword?: Keyword }) => {
})}
className="grid grid-cols-6 gap-3"
>
<div className="card bg-base-200 shadow-xl col-span-6 ">
<div className="card bg-base-200 col-span-6 shadow-xl">
<div className="card-body">
<h2 className="card-title">
<FileText className="w-5 h-5" /> Allgemeines
<FileText className="h-5 w-5" /> Allgemeines
</h2>
<label className="form-control w-full ">
<span className="label-text text-lg flex items-center gap-2">Kategorie</span>
<label className="form-control w-full">
<span className="label-text flex items-center gap-2 text-lg">Kategorie</span>
<select
className="input-sm select select-bordered select-sm w-full"
{...form.register("category")}
@@ -70,8 +68,8 @@ export const KeywordForm = ({ keyword }: { keyword?: Keyword }) => {
</div>
</div>
<div className="card bg-base-200 shadow-xl col-span-6">
<div className="card-body ">
<div className="card bg-base-200 col-span-6 shadow-xl">
<div className="card-body">
<div className="flex w-full gap-4">
<Button
isLoading={form.formState.isSubmitting}
@@ -83,7 +81,6 @@ export const KeywordForm = ({ keyword }: { keyword?: Keyword }) => {
{keyword && (
<Button
onClick={async () => {
setDeleteLoading(true);
await deleteKeyword(keyword.id);
redirect("/admin/keyword");
}}