unit template
This commit is contained in:
1 parent
c15e69f7b5
commit
3bea468d23
11 files changed
+391
-4
No files matched your search
@@ -28,6 +28,7 @@ export default async function PageUnits() {
|
||||
|
||||
<Card className="flex flex-col m-4 w-170 ">
|
||||
<CardHeader>Units</CardHeader>
|
||||
<Link className="m-2 underline" href="/rk2/units/templates">Unit-Vorlagen / Aus Vorlage hinzufügen</Link>
|
||||
|
||||
<Button size={"xs"} className="w-30 mt-2 ms-2 mb-2">
|
||||
<Link href={Sites.rk2.units.new.url}>{Sites.rk2.units.new.name}</Link>
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import Link from 'next/link';
|
||||
import { api_templates_list } from '@/actions/rk2/api-unit-templates';
|
||||
import { api_groups } from '@/actions/rk2/api-groups';
|
||||
import { api_anlage_getSelected } from '@/actions/rk/api-anlage';
|
||||
import { componentDefaults, componentTypeDefinitions } from '@/actions/rk2/api-compTypes';
|
||||
import { UnitTemplates } from '@/components/rk2/units/unitTemplates';
|
||||
|
||||
export default async function PageUnitTemplates() {
|
||||
const [result, groups, anlage] = await Promise.all([api_templates_list(), api_groups(), api_anlage_getSelected()]);
|
||||
return <div className="m-4">
|
||||
<Link href="/rk2/units" className="underline">Zurück zu Units</Link>
|
||||
<h1 className="my-4 text-xl font-semibold">Unit-Vorlagen</h1>
|
||||
<p className="mb-4">Vorlagen gelten für alle Anlagen. Eingefügt wird in: {anlage.name}</p>
|
||||
{result.success ? <UnitTemplates initial={result.data} groups={groups} componentTypes={componentTypeDefinitions} componentDefaults={componentDefaults} /> : <p role="alert">{result.errors.join(', ')}</p>}
|
||||
</div>;
|
||||
}
|
||||
Reference in new issue
Block a user