-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d949af
commit 353be19
Showing
7 changed files
with
55 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/app/features/cases/components/organisms/CaseDetail/sections/Owner.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React, { FC } from "react" | ||
import styled from "styled-components" | ||
import { BrkData, BrkDataError, Case } from "app/features/types" | ||
|
||
const Ul = styled.ul` | ||
list-style-position: inside; | ||
padding-left: 0; | ||
` | ||
|
||
type Props = { | ||
caseData: Case | ||
} | ||
|
||
const Owner: FC<Props> = ({ caseData: { brk_data } }) => { | ||
const hasBrkError = (brk_data as BrkDataError).error | ||
// An error has occurred! | ||
if (hasBrkError) { | ||
return <>BRK-gegevens kunnen momenteel niet worden opgehaald.</> | ||
} | ||
|
||
const brkData = brk_data as BrkData | ||
|
||
if (brkData.results.length) { | ||
const rechten = brkData.results.map(result => ( | ||
<span key={ result.id }> | ||
{ result?.cultuurcode_bebouwd?.omschrijving && ( | ||
<b>{ result?.cultuurcode_bebouwd?.omschrijving }</b> | ||
)} | ||
<Ul>{ result?.rechten?.map(recht => <li key={ recht.id } >{ recht._display }</li>) }</Ul> | ||
</span> | ||
)) | ||
return ( | ||
<span className="anonymous"> | ||
{ rechten } | ||
</span> | ||
) | ||
} | ||
// BRK is empty and that shouldn't be possible. | ||
return <>Er zijn geen BRK-gegevens gevonden.</> | ||
} | ||
|
||
export default Owner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters