@@ -2,9 +2,9 @@ import { Box, Text, VStack } from '@chakra-ui/react'
2
2
import { Contributor } from '@components/mdx/Contributor'
3
3
4
4
interface ContributorFooterProps {
5
- authors : string [ ]
6
- reviewers : string [ ]
7
- contributors : string [ ]
5
+ authors ? : string [ ]
6
+ reviewers ? : string [ ]
7
+ contributors ? : string [ ]
8
8
}
9
9
10
10
export function ContributorFooter ( {
@@ -20,7 +20,7 @@ export function ContributorFooter({
20
20
borderTopWidth = "thin"
21
21
borderColor = "gray"
22
22
>
23
- { authors && authors . length > 0 && (
23
+ { authors && Array . isArray ( authors ) && authors . length > 0 && (
24
24
< Box >
25
25
< Text fontSize = { 26 } marginTop = { 8 } marginBottom = { 4 } >
26
26
{ authors . length > 1 ? 'Authors' : 'Author' }
@@ -33,7 +33,7 @@ export function ContributorFooter({
33
33
</ Box >
34
34
) }
35
35
36
- { reviewers && reviewers . length > 0 && (
36
+ { reviewers && Array . isArray ( reviewers ) && reviewers . length > 0 && (
37
37
< Box >
38
38
< Text fontSize = { 20 } marginTop = { 8 } marginBottom = { 4 } >
39
39
{ reviewers . length > 1 ? 'Reviewers' : 'Reviewer' }
@@ -46,20 +46,22 @@ export function ContributorFooter({
46
46
</ Box >
47
47
) }
48
48
49
- { contributors && contributors . length > 0 && (
50
- < Box >
51
- < Text fontSize = { 20 } marginTop = { 8 } marginBottom = { 4 } >
52
- { contributors . length > 1
53
- ? 'Additional Contributors'
54
- : 'Additional Contributor' }
55
- </ Text >
56
- < VStack spacing = { 4 } alignItems = "left" >
57
- { contributors . map ( ( contrib ) => {
58
- return < Contributor handle = { contrib } avatarSize = "lg" />
59
- } ) }
60
- </ VStack >
61
- </ Box >
62
- ) }
49
+ { contributors &&
50
+ Array . isArray ( contributors ) &&
51
+ contributors . length > 0 && (
52
+ < Box >
53
+ < Text fontSize = { 20 } marginTop = { 8 } marginBottom = { 4 } >
54
+ { contributors . length > 1
55
+ ? 'Additional Contributors'
56
+ : 'Additional Contributor' }
57
+ </ Text >
58
+ < VStack spacing = { 4 } alignItems = "left" >
59
+ { contributors . map ( ( contrib ) => {
60
+ return < Contributor handle = { contrib } avatarSize = "lg" />
61
+ } ) }
62
+ </ VStack >
63
+ </ Box >
64
+ ) }
63
65
</ Box >
64
66
)
65
67
}
0 commit comments