File tree Expand file tree Collapse file tree 1 file changed +26
-5
lines changed Expand file tree Collapse file tree 1 file changed +26
-5
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,12 @@ import Card from 'components/Card';
2
2
import dayjs from 'dayjs' ;
3
3
import data from 'data/posts' ;
4
4
5
- export default function Home ( { posts} ) {
5
+ export default function Home ( { posts} : indexComponent ) {
6
6
return (
7
7
< main className = "container" >
8
8
9
9
{
10
- posts . map ( item => < Card
10
+ posts . map ( ( item : indexPropsComponent ) => < Card
11
11
12
12
key = { item . id }
13
13
@@ -30,11 +30,32 @@ export default function Home({posts}) {
30
30
)
31
31
}
32
32
33
- export async function getStaticProps ( context ) {
34
-
35
-
33
+ export async function getStaticProps ( ) {
36
34
37
35
return {
38
36
props : { posts :data } ,
39
37
}
38
+ }
39
+
40
+ interface indexComponent {
41
+ posts : {
42
+ [ x : string ] : any ;
43
+ tags : string ;
44
+ date : string ;
45
+ title : string ;
46
+ description : string ;
47
+ image : string ;
48
+ author : string ;
49
+ }
50
+ }
51
+
52
+ interface indexPropsComponent {
53
+ id : string ;
54
+ tags : string ;
55
+ date : string ;
56
+ title : string ;
57
+ description : string ;
58
+ image : string ;
59
+ author : string ;
60
+
40
61
}
You can’t perform that action at this time.
0 commit comments