Skip to content

Commit 111e50c

Browse files
authored
MIM-530 - tree: render residence status (#63)
1 parent ea2fe64 commit 111e50c

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

packages/property-tree/src/components/residence/ResidenceBasicInfo.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ import {
77
import { useIsMobile } from '../hooks/useMobile'
88
import { components } from '@/services/api/core/generated/api-types'
99

10-
type ResidenceDetails = components['schemas']['ResidenceDetails']
11-
1210
interface ResidenceBasicInfoProps {
13-
residence: ResidenceDetails
11+
residence: components['schemas']['ResidenceDetails']
1412
}
1513

1614
export const ResidenceBasicInfo = ({ residence }: ResidenceBasicInfoProps) => {
@@ -59,7 +57,11 @@ export const ResidenceBasicInfo = ({ residence }: ResidenceBasicInfoProps) => {
5957
<div>
6058
<p className="text-sm text-muted-foreground">Status</p>
6159
<p className="font-medium">
62-
{residence.deleted ? 'Borttagen' : 'Aktiv'}
60+
{residence.status === 'LEASED'
61+
? 'Uthyrd'
62+
: residence.status === 'VACANT'
63+
? 'Vakant'
64+
: 'N/A'}
6365
</p>
6466
</div>
6567
<div>

packages/property-tree/src/services/api/core/generated/api-types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2266,6 +2266,8 @@ export interface components {
22662266
id: string;
22672267
code: string;
22682268
name: string | null;
2269+
/** @enum {string|null} */
2270+
status: "VACANT" | "LEASED" | null;
22692271
location: string | null;
22702272
accessibility: {
22712273
wheelchairAccessible: boolean;

packages/property-tree/src/services/api/residenceService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Residence } from '../types'
21
import { GET } from './core/base-api'
32
import { components } from './core/generated/api-types'
43

4+
type Residence = components['schemas']['Residence']
55
type ResidenceDetails = components['schemas']['ResidenceDetails']
66

77
export const residenceService = {

0 commit comments

Comments
 (0)