@@ -15,6 +15,7 @@ export interface PostType {
1515 } ;
1616 slug : string ;
1717 estimated_time : number ;
18+ article_level : string ;
1819}
1920
2021export function PostList ( ) {
@@ -47,6 +48,12 @@ export function PostList() {
4748 } , { } ) ;
4849 }
4950
51+ const levelColors : Record < string , string > = {
52+ Iniciante : "bg-[#B4CB3F]" ,
53+ Intermediário : "bg-[#408EEB]" ,
54+ Avançado : "bg-[#7B66D4]" ,
55+ } ;
56+
5057 const postsByCategory = groupPostsByCategory ( posts ) ;
5158
5259 return (
@@ -65,7 +72,7 @@ export function PostList() {
6572 { posts . map ( ( post ) => (
6673 < li
6774 key = { post . id }
68- className = "dark:bg-[#1E293B] bg-[#93C5FD] p-6 rounded-lg dark:hover:bg-[#334155] hover:bg-[#71b4ff] transition w-[20rem] md:w-full h-full flex flex-col"
75+ className = "dark:bg-[#1E293B] bg-[#93C5FD] p-4 rounded-lg dark:hover:bg-[#334155] hover:bg-[#71b4ff] transition w-[20rem] md:w-full h-full flex flex-col"
6976 >
7077 < div className = "flex flex-col gap-4 flex-grow" >
7178 < Link to = { `/posts/${ post . slug } ` } className = "no-underline" >
@@ -86,7 +93,7 @@ export function PostList() {
8693 </ p >
8794 </ div >
8895
89- < div className = "flex items-center justify-between" >
96+ < div className = "flex items-center justify-between gap-4 " >
9097 < Link
9198 to = { `/posts/${ post . slug } ` }
9299 className = "flex items-center gap-2 font-bold mt-auto min-h-14 text-sm dark:text-white text-black dark:hover:text-blue-400 hover:underline"
@@ -95,11 +102,22 @@ export function PostList() {
95102 < ArrowRight size = { 16 } />
96103 </ Link >
97104
98- < div className = "flex items-center gap-2" >
99- < Clock size = { 20 } weight = "bold" color = "#8ec5ff" />
100- < p className = "text-sm font-semibold text-blue-400" >
101- { post . estimated_time } min
102- </ p >
105+ < div className = "flex items-center gap-2 lg:gap-4" >
106+ < span
107+ className = { `w-[6rem] h-[1.5rem] lg:w-[6.5rem] lg:h-[1.625rem] rounded-full text-xs text-black font-semibold flex items-center justify-center ${
108+ levelColors [ post . article_level ] ||
109+ "bg-gray-200 text-gray-700"
110+ } `}
111+ >
112+ < p > { post . article_level } </ p >
113+ </ span >
114+
115+ < div className = "flex items-center gap-2" >
116+ < Clock size = { 20 } weight = "bold" color = "#8ec5ff" />
117+ < p className = "text-sm font-semibold text-blue-400" >
118+ { post . estimated_time } min
119+ </ p >
120+ </ div >
103121 </ div >
104122 </ div >
105123 </ li >
0 commit comments