mirror of
https://github.com/status-im/spiff-arena.git
synced 2025-01-29 19:25:50 +00:00
36 lines
998 B
TypeScript
36 lines
998 B
TypeScript
import { useState } from 'react';
|
|
import ProcessBreadcrumb from '../components/ProcessBreadcrumb';
|
|
import ProcessGroupForm from '../components/ProcessGroupForm';
|
|
import { ProcessGroup, HotCrumbItem } from '../interfaces';
|
|
|
|
export default function ProcessGroupNew() {
|
|
const searchParams = new URLSearchParams(document.location.search);
|
|
const parentGroupId = searchParams.get('parentGroupId');
|
|
const [processGroup, setProcessGroup] = useState<ProcessGroup>({
|
|
id: '',
|
|
display_name: '',
|
|
description: '',
|
|
});
|
|
|
|
const hotCrumbs: HotCrumbItem[] = [['Process Groups', '/admin']];
|
|
if (parentGroupId) {
|
|
hotCrumbs.push({
|
|
entityToExplode: parentGroupId,
|
|
entityType: 'process-group-id',
|
|
linkLastItem: true,
|
|
});
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<ProcessBreadcrumb hotCrumbs={hotCrumbs} />
|
|
<h1>Add Process Group</h1>
|
|
<ProcessGroupForm
|
|
mode="new"
|
|
processGroup={processGroup}
|
|
setProcessGroup={setProcessGroup}
|
|
/>
|
|
</>
|
|
);
|
|
}
|