1- import { Avatar , Card , CardContent , CardProps , Chip , Icon , Stack , Typography } from '@mui/material' ;
1+ import { Avatar , Card , CardContent , CardProps , Chip } from '@mui/material' ;
22import { marked } from 'marked' ;
33import { Issue } from 'mobx-github' ;
44import { FC } from 'react' ;
55
6+ import { SymbolIcon } from '../../Icon' ;
7+
68export type IssueCardProps = Issue & Omit < CardProps , 'id' > ;
79
810export const IssueCard : FC < IssueCardProps > = ( {
911 id,
12+ repository_url,
1013 number,
1114 title,
1215 labels,
@@ -18,19 +21,21 @@ export const IssueCard: FC<IssueCardProps> = ({
1821 ...props
1922} ) => (
2023 < Card { ...props } >
21- < CardContent >
22- < Typography
23- variant = "h4"
24- component = "a"
25- href = { html_url }
26- target = "_blank"
27- rel = "noreferrer"
28- style = { { textDecoration : 'none' , color : 'inherit' } }
29- >
30- #{ number } { title }
31- </ Typography >
24+ < CardContent className = "flex h-full flex-col justify-between gap-2" >
25+ < h2 className = "text-2xl" >
26+ < a
27+ href = { html_url }
28+ target = "_blank"
29+ rel = "noreferrer"
30+ style = { { textDecoration : 'none' , color : 'inherit' } }
31+ >
32+ { repository_url . split ( '/' ) . slice ( - 2 ) . join ( '/' ) } #{ number }
33+ < br />
34+ { title }
35+ </ a >
36+ </ h2 >
3237
33- < Stack direction = "row" spacing = { 1 } >
38+ < div className = "flex items-center gap-2" >
3439 { labels ?. map (
3540 label =>
3641 typeof label === 'object' && (
@@ -41,22 +46,23 @@ export const IssueCard: FC<IssueCardProps> = ({
4146 />
4247 ) ,
4348 ) }
44- </ Stack >
45-
46- < Typography component = "article" dangerouslySetInnerHTML = { { __html : marked ( body || '' ) } } />
49+ </ div >
4750
48- { user && (
49- < Stack direction = "row" spacing = { 1 } alignItems = "center" >
50- < Avatar src = { user . avatar_url } alt = { user . name || '' } />
51- < Typography > { user . name || '' } </ Typography >
52- </ Stack >
53- ) }
54- < Stack direction = "row" spacing = { 1 } alignItems = "center" >
55- < Icon > chat_bubble_outline</ Icon >
56- { comments }
57- </ Stack >
51+ < article dangerouslySetInnerHTML = { { __html : marked ( body || '' ) } } />
5852
59- < time dateTime = { created_at } > { new Date ( created_at ) . toLocaleString ( ) } </ time >
53+ < footer className = "flex items-center justify-between" >
54+ { user && (
55+ < div className = "flex items-center gap-2" >
56+ < Avatar src = { user . avatar_url } alt = { user . name || '' } />
57+ { user . name || '' }
58+ </ div >
59+ ) }
60+ < div className = "flex items-center gap-2" >
61+ < SymbolIcon name = "chat" />
62+ { comments }
63+ </ div >
64+ < time dateTime = { created_at } > { new Date ( created_at ) . toLocaleString ( ) } </ time >
65+ </ footer >
6066 </ CardContent >
6167 </ Card >
6268) ;
0 commit comments