continue Event page
This commit is contained in:
@@ -4,8 +4,8 @@ import {
|
||||
GearIcon,
|
||||
ExitIcon,
|
||||
LockClosedIcon,
|
||||
} from "@radix-ui/react-icons";
|
||||
import Link from "next/link";
|
||||
} from '@radix-ui/react-icons';
|
||||
import Link from 'next/link';
|
||||
|
||||
export const VerticalNav = () => {
|
||||
return (
|
||||
@@ -34,6 +34,9 @@ export const VerticalNav = () => {
|
||||
<li>
|
||||
<Link href="/admin/station">Stationen</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link href="/admin/event">Events</Link>
|
||||
</li>
|
||||
</ul>
|
||||
</details>
|
||||
</li>
|
||||
|
||||
33
apps/hub/app/_components/ui/Switch.tsx
Normal file
33
apps/hub/app/_components/ui/Switch.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import {
|
||||
FieldValues,
|
||||
Path,
|
||||
RegisterOptions,
|
||||
UseFormReturn,
|
||||
} from 'react-hook-form';
|
||||
import { cn } from '../../../helper/cn';
|
||||
|
||||
interface InputProps<T extends FieldValues>
|
||||
extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'form'> {
|
||||
name: Path<T>;
|
||||
form: UseFormReturn<T>;
|
||||
formOptions?: RegisterOptions<T>;
|
||||
label?: string;
|
||||
}
|
||||
|
||||
export const Switch = <T extends FieldValues>({
|
||||
name,
|
||||
label = name,
|
||||
form,
|
||||
formOptions,
|
||||
className,
|
||||
...inputProps
|
||||
}: InputProps<T>) => {
|
||||
return (
|
||||
<div className="form-control">
|
||||
<label className="label cursor-pointer">
|
||||
<span className={cn('label-text', className)}>{label}</span>
|
||||
<input type="checkbox" className="toggle" {...form.register(name)} />
|
||||
</label>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user