added event helpers to ui libary, added Badge component, reordered Dashboard Components, splitted Event Admin page

This commit is contained in:
PxlLoewe
2025-03-07 14:16:19 -07:00
parent c1f1ad47b7
commit 829e78a47d
25 changed files with 465 additions and 355 deletions

View File

@@ -0,0 +1,37 @@
import DatePicker, { DatePickerProps, registerLocale } from "react-datepicker";
import {
Control,
Controller,
FieldValues,
Path,
PathValue,
} from "react-hook-form";
import { de } from "date-fns/locale";
registerLocale("de", de);
interface DateInputProps<T extends FieldValues>
extends Omit<DatePickerProps, "onChange" | "selected"> {
control: Control<T>;
name: Path<T>;
}
export const DateInput = <T extends FieldValues>({
control,
name,
...props
}: DateInputProps<T>) => {
return (
<Controller
control={control}
name={name}
render={({ field }) => (
<DatePicker
locale={"de"}
onChange={(date) => field.onChange(date)}
selected={field.value}
{...(props as any)}
/>
)}
/>
);
};