fix: a lot of minor improvements for dashboard

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-11-07 12:28:54 +01:00
parent 5b1c582023
commit c762bd7c95
19 changed files with 591 additions and 388 deletions

View File

@@ -18,7 +18,11 @@ import { ModalContent, ModalHeader } from './Modal/Container';
type IForm = z.infer<typeof zCreateReference>;
export default function AddReference() {
interface AddReferenceProps {
datetime?: string;
}
export default function AddReference({ datetime }: AddReferenceProps = {}) {
const { projectId } = useAppParams();
const queryClient = useQueryClient();
const { register, handleSubmit, formState, control } = useForm<IForm>({
@@ -27,7 +31,7 @@ export default function AddReference() {
title: '',
description: '',
projectId,
datetime: new Date().toISOString(),
datetime: datetime || new Date().toISOString(),
},
});
@@ -52,7 +56,7 @@ export default function AddReference() {
className="flex flex-col gap-4"
onSubmit={handleSubmit((values) => mutation.mutate(values))}
>
<InputWithLabel label="Title" {...register('title')} />
<InputWithLabel label="Title" {...register('title')} autoFocus />
<InputWithLabel label="Description" {...register('description')} />
<Controller
control={control}