33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import Link from "next/link";
|
|
import { manufacturerFindById } from "../../../../actions/manufacturer.actions";
|
|
import { ManufactuererForm } from "../../../../components/manufacturer/manufacturer.form";
|
|
import { sites } from "../../../../_config/sites";
|
|
|
|
|
|
interface PageProps {
|
|
params: Promise<{ id: string }>
|
|
|
|
}
|
|
export default async function CatergoryUpdate({ params }: PageProps) {
|
|
|
|
|
|
const { id } = await params
|
|
const hersteller = await manufacturerFindById(id);
|
|
|
|
if(!hersteller._id) {
|
|
return (<div>
|
|
<div>Hersteller nicht gefunden</div>
|
|
<div>
|
|
<Link className="cursor-pointer p-2 border-1 border-sky-500 bg-sky-500 text-white rounded-full m-1 hover:bg-sky-700 " href={sites.manufacturer.url}>zurück</Link>
|
|
</div>
|
|
</div>)
|
|
}
|
|
|
|
return (
|
|
<div className="h-screen">
|
|
<ManufactuererForm initData={hersteller} ></ManufactuererForm>
|
|
<Link className="cursor-pointer p-2 border-1 border-sky-500 bg-sky-500 text-white rounded-full m-1 hover:bg-sky-700 " href={sites.manufacturer.url}>zurück</Link>
|
|
</div>
|
|
);
|
|
}
|