@@ -6,15 +6,13 @@ import { SingleReception } from './SingleReception';
6
6
import { translator } from 'translations' ;
7
7
8
8
import styles from './Reception.module.scss' ;
9
- import { forceArray } from 'utils/arrays' ;
10
9
11
10
interface LocationsProps {
12
- receptions : AudienceReception [ ] | AudienceReception ;
11
+ receptions : AudienceReception [ ] ;
13
12
language : Language ;
14
13
}
15
14
16
15
export const Reception = ( { receptions, language } : LocationsProps ) => {
17
- const receptionArray = forceArray ( receptions ) ;
18
16
const getOfficeTranslations = translator ( 'office' , language ) ;
19
17
20
18
const getLocation = ( reception : AudienceReception ) => {
@@ -32,17 +30,17 @@ export const Reception = ({ receptions, language }: LocationsProps) => {
32
30
return label . replace ( / \s / g, '-' ) . toLowerCase ( ) ;
33
31
} ;
34
32
35
- const firstLocation = getLocation ( receptionArray [ 0 ] ) ;
33
+ const firstLocation = getLocation ( receptions [ 0 ] ) ;
36
34
const [ state , setState ] = useState ( getIdFromLabel ( firstLocation ) ) ;
37
35
38
- if ( ! receptionArray || receptionArray . length === 0 ) {
36
+ if ( ! receptions || receptions . length === 0 ) {
39
37
return null ;
40
38
}
41
39
42
- if ( receptionArray . length === 1 ) {
40
+ if ( receptions . length === 1 ) {
43
41
return (
44
42
< div className = { styles . singleTab } >
45
- < SingleReception { ...receptionArray [ 0 ] } />
43
+ < SingleReception { ...receptions [ 0 ] } />
46
44
</ div >
47
45
) ;
48
46
}
@@ -58,7 +56,7 @@ export const Reception = ({ receptions, language }: LocationsProps) => {
58
56
className = { styles . officeTabs }
59
57
>
60
58
< Tabs . List >
61
- { receptionArray . map ( ( loc : AudienceReception , index ) => {
59
+ { receptions . map ( ( loc : AudienceReception , index ) => {
62
60
const locationLabel = getLocation ( loc ) ;
63
61
return (
64
62
< Tabs . Tab
@@ -69,7 +67,7 @@ export const Reception = ({ receptions, language }: LocationsProps) => {
69
67
) ;
70
68
} ) }
71
69
</ Tabs . List >
72
- { receptionArray . map ( ( loc : AudienceReception , index ) => {
70
+ { receptions . map ( ( loc : AudienceReception , index ) => {
73
71
const locationLabel = getLocation ( loc ) ;
74
72
return (
75
73
< Tabs . Panel
0 commit comments