Skip to content

Commit

Permalink
Merge pull request #201 from Amsterdam/feature/WON-81-add-case-state
Browse files Browse the repository at this point in the history
WON-81
  • Loading branch information
remyvdwereld authored Jan 27, 2025
2 parents 25054c0 + ba9d793 commit c5751f1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 12 deletions.
21 changes: 21 additions & 0 deletions src/__generated__/apiSchema.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 14 additions & 12 deletions src/app/pages/CaseDetailsPage/Workflows/Workflows.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Heading } from "@amsterdam/design-system-react"
import { styled } from "styled-components"
import { useWorkflows } from "app/state/rest"
import { Table, SmallSkeleton } from "app/components"
import { styled } from "styled-components"
import getColumns from "./columns"


type Props = {
caseId: Components.Schemas.Case["id"]
}
Expand All @@ -19,29 +19,31 @@ const TableWrapper = styled.div`

export const Workflows: React.FC<Props> = ({ caseId }) => {
const [data, { isBusy }] = useWorkflows(caseId)
const workflows = data ?? []
const workflows = data ?? ([] as Components.Schemas.CaseWorkflow[])
const columns = getColumns(caseId)

if (isBusy) {
return <SmallSkeleton height={ 4 } />
return <SmallSkeleton height={4} />
}
return (
<Wrapper>
{ workflows?.length > 0 ? (
workflows.map(({ id, tasks = [] }) => (
<TableWrapper key={ `${ id }` }>
{workflows?.length > 0 ? (
workflows.map(({ id, state, tasks = [] }) => (
<TableWrapper key={`${ id }`}>
{state?.name ? <Heading level={4}>{state.name}</Heading> : <></>}
<Table
columns={ columns }
data={ tasks }
pagination={ false }
columns={columns}
data={tasks}
pagination={false}
emptyPlaceholder="Geen taken beschikbaar."
/>
</TableWrapper>
))
) : <></>}
) : (
<></>
)}
</Wrapper>
)
}

export default Workflows

0 comments on commit c5751f1

Please sign in to comment.