Skip to content

Commit 387adc6

Browse files
committed
fjern ekstra forcearray, brukes allerede i OfficeInformation
1 parent a0f6375 commit 387adc6

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/components/_common/office-details/reception/Reception.tsx

+7-9
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ import { SingleReception } from './SingleReception';
66
import { translator } from 'translations';
77

88
import styles from './Reception.module.scss';
9-
import { forceArray } from 'utils/arrays';
109

1110
interface LocationsProps {
12-
receptions: AudienceReception[] | AudienceReception;
11+
receptions: AudienceReception[];
1312
language: Language;
1413
}
1514

1615
export const Reception = ({ receptions, language }: LocationsProps) => {
17-
const receptionArray = forceArray(receptions);
1816
const getOfficeTranslations = translator('office', language);
1917

2018
const getLocation = (reception: AudienceReception) => {
@@ -32,17 +30,17 @@ export const Reception = ({ receptions, language }: LocationsProps) => {
3230
return label.replace(/\s/g, '-').toLowerCase();
3331
};
3432

35-
const firstLocation = getLocation(receptionArray[0]);
33+
const firstLocation = getLocation(receptions[0]);
3634
const [state, setState] = useState(getIdFromLabel(firstLocation));
3735

38-
if (!receptionArray || receptionArray.length === 0) {
36+
if (!receptions || receptions.length === 0) {
3937
return null;
4038
}
4139

42-
if (receptionArray.length === 1) {
40+
if (receptions.length === 1) {
4341
return (
4442
<div className={styles.singleTab}>
45-
<SingleReception {...receptionArray[0]} />
43+
<SingleReception {...receptions[0]} />
4644
</div>
4745
);
4846
}
@@ -58,7 +56,7 @@ export const Reception = ({ receptions, language }: LocationsProps) => {
5856
className={styles.officeTabs}
5957
>
6058
<Tabs.List>
61-
{receptionArray.map((loc: AudienceReception, index) => {
59+
{receptions.map((loc: AudienceReception, index) => {
6260
const locationLabel = getLocation(loc);
6361
return (
6462
<Tabs.Tab
@@ -69,7 +67,7 @@ export const Reception = ({ receptions, language }: LocationsProps) => {
6967
);
7068
})}
7169
</Tabs.List>
72-
{receptionArray.map((loc: AudienceReception, index) => {
70+
{receptions.map((loc: AudienceReception, index) => {
7371
const locationLabel = getLocation(loc);
7472
return (
7573
<Tabs.Panel

0 commit comments

Comments
 (0)