header & footer

This commit is contained in:
2024-01-16 10:24:21 +01:00
parent 92eacc2764
commit 226beb974f
13 changed files with 101 additions and 41 deletions

View File

@@ -6,6 +6,8 @@ import { BillingLocation, YearMonth } from "../lib/db-types";
import { updateOrAddLocation } from "../lib/actions/locationActions";
import { useFormState } from "react-dom";
import { gotoHome } from "../lib/actions/billActions";
import { Main } from "./Main";
import Link from "next/link";
export interface LocationEditFormProps {
/** location which should be edited */
@@ -27,15 +29,15 @@ export const LocationEditForm:FC<LocationEditFormProps> = ({ location, yearMonth
};
return(
<main>
<div className="card card-compact card-bordered max-w-sm bg-base-100 shadow-s my-1">
<Main>
<div className="card card-compact card-bordered min-w-96 bg-base-100 shadow-s my-1">
<div className="card-body">
<form action={dispatch}>
{
location &&
<a href={`/location/${location._id}/delete`} className="absolute bottom-5 right-4 tooltip" data-tip="Delete Location">
<Link href={`/location/${location._id}/delete`} className="absolute bottom-5 right-4 tooltip" data-tip="Delete Location">
<TrashIcon className="h-[1em] w-[1em] text-error text-2xl" />
</a>
</Link>
}
<input id="locationName" name="locationName" type="text" placeholder="Naziv lokacije" className="input input-bordered w-full" defaultValue={location?.name ?? ""} />
<div id="status-error" aria-live="polite" aria-atomic="true">
@@ -66,11 +68,13 @@ export const LocationEditForm:FC<LocationEditFormProps> = ({ location, yearMonth
}
</div>
<button className="btn btn-primary">Save</button>
<button type="button" className="btn btn-neutral ml-3" onClick={handleCancel}>Cancel</button>
<div className="pt-4">
<button className="btn btn-primary">Save</button>
<button type="button" className="btn btn-neutral ml-3" onClick={handleCancel}>Cancel</button>
</div>
</form>
</div>
</div>
</main>
</Main>
)
}