File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,12 +23,14 @@ export declare interface Link {
2323 link : string ,
2424}
2525
26+ declare interface IssueLinks extends Array < Link > { }
27+
2628export declare interface ProjectSummaryData {
2729 projectName : string ,
2830 title : string ,
2931 owners : Array < PersonProps > ,
3032 status : string ,
31- issueLinks ?: Array < Link > ,
33+ issueLinks ?: IssueLinks ,
3234 discussionLinks ?: Array < Link > ,
3335}
3436
Original file line number Diff line number Diff line change @@ -48,6 +48,38 @@ export default function ProjectSummary(props: ProjectSummaryProps): ReactNode {
4848 ) ;
4949 }
5050
51+ function getIssueLinks ( { issueLinks } : ProjectSummaryData ) : ReactNode {
52+ if ( issueLinks . length === 1 ) {
53+ return (
54+ < >
55+ { issueLinks . map ( ( { link, title } ) => (
56+ < div key = { title } >
57+ < Link
58+ to = { link }
59+ >
60+ { title }
61+ </ Link >
62+ </ div >
63+ ) ) }
64+ </ >
65+ ) ;
66+ }
67+
68+ return (
69+ < ul >
70+ { issueLinks . map ( ( { link, title } ) => (
71+ < li key = { title } >
72+ < Link
73+ to = { link }
74+ >
75+ { title }
76+ </ Link >
77+ </ li >
78+ ) ) }
79+ </ ul >
80+ ) ;
81+ }
82+
5183 function GetProjectSummary ( projectData : ProjectSummaryData ) : ReactNode {
5284 return (
5385 < div className = { styles . projectsummary } >
@@ -82,17 +114,7 @@ export default function ProjectSummary(props: ProjectSummaryProps): ReactNode {
82114 && (
83115 < tr >
84116 < th > Issues</ th >
85- < td >
86- { projectData . issueLinks . map ( ( { link, title } ) => (
87- < div key = { title } >
88- < Link
89- to = { link }
90- >
91- { title }
92- </ Link >
93- </ div >
94- ) ) }
95- </ td >
117+ < td > { getIssueLinks ( projectData ) } </ td >
96118 </ tr >
97119 ) }
98120 </ tbody >
You can’t perform that action at this time.
0 commit comments