diff --git a/app/[locale]/location/[id]/add/LocationAddPage.tsx b/app/[locale]/location/[id]/add/LocationAddPage.tsx
index 9556980..93c65ec 100644
--- a/app/[locale]/location/[id]/add/LocationAddPage.tsx
+++ b/app/[locale]/location/[id]/add/LocationAddPage.tsx
@@ -1,6 +1,8 @@
import { LocationEditForm } from '@/app/ui/LocationEditForm';
import { YearMonth } from '@/app/lib/db-types';
+import { getUserSettings } from '@/app/lib/actions/userSettingsActions';
export default async function LocationAddPage({ yearMonth }: { yearMonth:YearMonth }) {
- return ();
+ const userSettings = await getUserSettings();
+ return ();
}
\ No newline at end of file
diff --git a/app/[locale]/location/[id]/edit/LocationEditPage.tsx b/app/[locale]/location/[id]/edit/LocationEditPage.tsx
index 505f634..b99203e 100644
--- a/app/[locale]/location/[id]/edit/LocationEditPage.tsx
+++ b/app/[locale]/location/[id]/edit/LocationEditPage.tsx
@@ -1,6 +1,7 @@
import { notFound } from 'next/navigation';
import { LocationEditForm } from '@/app/ui/LocationEditForm';
import { fetchLocationById } from '@/app/lib/actions/locationActions';
+import { getUserSettings } from '@/app/lib/actions/userSettingsActions';
export default async function LocationEditPage({ locationId }: { locationId:string }) {
@@ -10,7 +11,9 @@ export default async function LocationEditPage({ locationId }: { locationId:stri
return(notFound());
}
- const result = ;
-
+ const userSettings = await getUserSettings();
+
+ const result = ;
+
return (result);
}
\ No newline at end of file
diff --git a/app/ui/LocationEditForm.tsx b/app/ui/LocationEditForm.tsx
index 8525413..00c5e1c 100644
--- a/app/ui/LocationEditForm.tsx
+++ b/app/ui/LocationEditForm.tsx
@@ -2,26 +2,31 @@
import { TrashIcon } from "@heroicons/react/24/outline";
import { FC, useState } from "react";
-import { BillingLocation, YearMonth } from "../lib/db-types";
+import { BillingLocation, UserSettings, YearMonth } from "../lib/db-types";
import { updateOrAddLocation } from "../lib/actions/locationActions";
import { useFormState } from "react-dom";
import Link from "next/link";
import { useLocale, useTranslations } from "next-intl";
import { InfoBox } from "./InfoBox";
+import { NoteBox } from "./NoteBox";
export type LocationEditFormProps = {
/** location which should be edited */
location: BillingLocation,
/** year adn month at a new billing location should be assigned */
- yearMonth?: undefined
+ yearMonth?: undefined,
+ /** user settings for payment configuration */
+ userSettings: UserSettings | null
} | {
/** location which should be edited */
location?: undefined,
/** year adn month at a new billing location should be assigned */
- yearMonth: YearMonth
+ yearMonth: YearMonth,
+ /** user settings for payment configuration */
+ userSettings: UserSettings | null
}
-export const LocationEditForm: FC = ({ location, yearMonth }) => {
+export const LocationEditForm: FC = ({ location, yearMonth, userSettings }) => {
const initialState = { message: null, errors: {} };
const handleAction = updateOrAddLocation.bind(null, location?._id, location?.yearMonth ?? yearMonth);
@@ -83,17 +88,28 @@ export const LocationEditForm: FC = ({ location, yearMont