@@ -25,97 +25,102 @@ export default async function ChangelogsListPage() {
2525
2626 return (
2727 < Fragment >
28- < header className = "mb-4 col-start-2 col-span-2 text-left " >
28+ < header className = "text-left pl-4 mb-4 " >
2929 < Button >
3030 < PlusIcon />
3131 < Link href = "/changelog/_admin/create" > New Changelog</ Link >
3232 </ Button >
3333 </ header >
34- < section className = "overflow-x-auto col-start-2 col-span-10 shadow-md rounded-lg" >
35- < table className = "w-full text-sm text-left text-gray-500" >
36- < thead className = "text-xs text-gray-700 uppercase bg-gray-50" >
34+
35+ < table className = "table-fixed w-11/12 mx-auto text-sm text-left text-gray-500" >
36+ < colgroup >
37+ < col style = { { width : '30%' } } />
38+ < col style = { { width : '30%' } } />
39+ < col style = { { width : '20%' } } />
40+ < col style = { { width : '20%' } } />
41+ </ colgroup >
42+ < thead className = "text-xs text-gray-700 uppercase bg-gray-50" >
43+ < tr >
44+ < th className = "whitespace-nowrap px-4 py-2" > Title</ th >
45+ < th className = "px-4 py-2 break-words" > Categories</ th >
46+ < th className = "whitespace-nowrap px-4 py-2" > Published by</ th >
47+ < th className = "px-4 py-2" />
48+ </ tr >
49+ </ thead >
50+ < tbody className = "divide-y divide-gray-200 bg-white border-b hover:bg-gray-50 dark:hover:bg-gray-600" >
51+ { changelogs . length === 0 && (
3752 < tr >
38- < th className = "whitespace-nowrap px-4 py-2" > Title</ th >
39- < th className = "whitespace-nowrap px-4 py-2" > Categories</ th >
40- < th className = "whitespace-nowrap px-4 py-2" > Published by</ th >
41- < th className = "px-4 py-2" />
53+ < td
54+ colSpan = { 4 }
55+ className = "text-center font-medium text-gray-900 whitespace-nowrap"
56+ >
57+ No changelogs found
58+ </ td >
4259 </ tr >
43- </ thead >
44- < tbody className = "divide-y divide-gray-200 bg-white border-b hover:bg-gray-50 dark:hover:bg-gray-600" >
45- { changelogs . length === 0 && (
46- < tr >
47- < td
48- colSpan = { 10 }
49- className = "text-center font-medium text-gray-900 whitespace-nowrap"
50- >
51- No changelogs found
52- </ td >
53- </ tr >
54- ) }
60+ ) }
5561
56- { changelogs . map ( changelog => (
57- < tr key = { changelog . id } className = "bg-white border-b hover:bg-gray-50" >
58- < td className = "px-6 py-4 font-medium text-gray-900" > { changelog . title } </ td >
62+ { changelogs . map ( changelog => (
63+ < tr key = { changelog . id } className = "bg-white border-b hover:bg-gray-50" >
64+ < td className = "px-6 py-2 font-medium text-gray-900" > { changelog . title } </ td >
5965
60- < td className = "px-4 py-2" >
61- { changelog . categories . map ( category => (
62- < div
63- key = { category . id }
64- className = "inline whitespace-nowrap p-2 uppercase shadow-sm no-underline rounded-full text-red text-xs mr-1 bg-gray-100"
65- >
66- { category . name }
67- </ div >
68- ) ) }
69- </ td >
70- < td className = "px-4 py-2 text-center" >
71- { changelog . published && (
72- < span className = "text-gray-500" >
73- < Text size = "1" >
74- { ' ' }
75- { new Date ( changelog . publishedAt || '' ) . toLocaleDateString (
76- undefined ,
77- { month : 'long' , day : 'numeric' }
78- ) }
79- </ Text >
80- < br />
81- </ span >
82- ) }
83- < Text size = "1" > { changelog . author ?. name } </ Text >
84- </ td >
66+ < td className = "px-4 py-2 break-words " >
67+ { changelog . categories . map ( category => (
68+ < div
69+ key = { category . id }
70+ className = "inline whitespace-nowrap p-2 uppercase shadow-sm no-underline rounded-full text-red text-xs mr-1 mb-4 bg-gray-100"
71+ >
72+ { category . name }
73+ </ div >
74+ ) ) }
75+ </ td >
76+ < td className = "px-4 py-2 text-center" >
77+ { changelog . published && (
78+ < span className = "text-gray-500" >
79+ < Text size = "1" >
80+ { ' ' }
81+ { new Date ( changelog . publishedAt || '' ) . toLocaleDateString (
82+ undefined ,
83+ { month : 'long' , day : 'numeric' }
84+ ) }
85+ </ Text >
86+ < br />
87+ </ span >
88+ ) }
89+ < Text size = "1" > { changelog . author ?. name } </ Text >
90+ </ td >
8591
86- < td className = "px-4 py-2" >
87- < div className = "flex h-full justify-end" >
88- < Link
89- href = { `/changelog/${ changelog . slug } ` }
90- className = "text-indigo-600 hover:bg-indigo-100 rounded-md px-1 py-2 text-xs whitespace-nowrap"
91- >
92- 👀 Show
93- </ Link >
94- < Link
95- href = { `/changelog/_admin/${ changelog . id } /edit` }
96- className = "text-indigo-600 hover:bg-indigo-100 rounded-md px-1 py-2 text-xs whitespace-nowrap"
97- >
98- 📝 Edit
99- </ Link >
100- { changelog . published ? (
101- < Confirm action = { unpublishChangelog } changelog = { changelog } >
102- ⛔️ Unpublish?
103- </ Confirm >
104- ) : (
105- < Confirm action = { publishChangelog } changelog = { changelog } >
106- ✅ Publish?
107- </ Confirm >
108- ) }
109- < Confirm action = { deleteChangelog } changelog = { changelog } >
110- 💀 Delete?
92+ < td className = "px-4 py-2" >
93+ < div className = "flex h-full justify-end" >
94+ < Link
95+ href = { `/changelog/${ changelog . slug } ` }
96+ className = "text-indigo-600 hover:bg-indigo-100 rounded-md px-1 py-2 text-xs whitespace-nowrap"
97+ >
98+ 👀 Show
99+ </ Link >
100+ < Link
101+ href = { `/changelog/_admin/${ changelog . id } /edit` }
102+ className = "text-indigo-600 hover:bg-indigo-100 rounded-md px-1 py-2 text-xs whitespace-nowrap"
103+ >
104+ 📝 Edit
105+ </ Link >
106+ { changelog . published ? (
107+ < Confirm action = { unpublishChangelog } changelog = { changelog } >
108+ ⛔️ Unpublish?
111109 </ Confirm >
112- </ div >
113- </ td >
114- </ tr >
115- ) ) }
116- </ tbody >
117- </ table >
118- </ section >
110+ ) : (
111+ < Confirm action = { publishChangelog } changelog = { changelog } >
112+ ✅ Publish?
113+ </ Confirm >
114+ ) }
115+ < Confirm action = { deleteChangelog } changelog = { changelog } >
116+ 💀 Delete?
117+ </ Confirm >
118+ </ div >
119+ </ td >
120+ </ tr >
121+ ) ) }
122+ </ tbody >
123+ </ table >
119124 </ Fragment >
120125 ) ;
121126}
0 commit comments