1- import { ReactNode } from 'react'
21import Link from 'next/link'
3- import { ArrowRightIcon } from '@heroicons/react/24/outline'
2+ import { ArrowRightIcon , PencilSquareIcon } from '@heroicons/react/24/outline'
3+ import { SectionContainer } from './ui/SectionContainer'
44
55// Temporarily disabled to test build - this fetches 6MB of data
66// import { getChangeHistoryServerSide } from '@/js/graphql/contribAPI'
@@ -13,40 +13,22 @@ export const LatestContributions: React.FC = async () => {
1313 // Temporarily disabled - fetches 6MB history just to show 10 items
1414 // const history = await getChangeHistoryServerSide()
1515 return (
16- < Container >
17- < div className = 'text-center text-base-content/60 py-8' >
18- Latest contributions temporarily disabled
19- </ div >
20- </ Container >
21- )
22- }
23-
24- /**
25- * Resuable container for actual and skeleton
26- */
27- const Container : React . FC < { children : ReactNode } > = ( { children } ) => (
28- < section className = 'px-4 w-full bg-base-200' >
29- < div className = 'mt-2 flex items-center justify-between' >
30- < p > LATEST CONTRIBUTIONS</ p >
31- < Link href = '/edit' className = 'text-sm hover:underline' > See more</ Link >
32- </ div >
33- < hr className = 'mb-6 border-1 border-base-content' />
34- < div className = 'mt-4 flex justify-center flex-row flex-wrap gap-y-10 gap-x-4' >
35- { children }
36- </ div >
37- < div className = 'flex justify-center py-10' >
38- < Link href = '/edit' className = 'btn btn-sm btn-outline' > See more < ArrowRightIcon className = 'w-4 h-4' /> </ Link >
39- </ div >
40- </ section >
41- )
42-
43- /**
44- * Loading skelton
45- */
46- export const LatestContributionsSkeleton : React . FC = ( ) => {
47- return (
48- < Container >
49- { [ 1 , 2 , 3 , 4 , 5 ] . map ( item => < div key = { item } className = 'w-full bg-base-200/20 h-36 rounded-box' /> ) }
50- </ Container >
16+ < SectionContainer header = { < h2 > Latest Contributions</ h2 > } >
17+ < Link
18+ href = '/edit'
19+ className = 'group flex items-center justify-between gap-4 w-full rounded-box border border-base-content/20 bg-base-200/40 hover:bg-base-200 hover:border-base-content/40 transition-all duration-200 p-5 lg:p-6'
20+ >
21+ < div className = 'flex items-center gap-4' >
22+ < div className = 'flex-shrink-0 w-10 h-10 rounded-box bg-base-content/10 group-hover:bg-base-content/15 flex items-center justify-center transition-colors duration-200' >
23+ < PencilSquareIcon className = 'w-5 h-5 text-base-content/70' />
24+ </ div >
25+ < div >
26+ < p className = 'font-semibold text-base-content text-sm uppercase tracking-wide' > View recent edits</ p >
27+ < p className = 'text-sm text-base-content/60 mt-0.5' > Browse the latest changes made by the community</ p >
28+ </ div >
29+ </ div >
30+ < ArrowRightIcon className = 'w-5 h-5 text-base-content/40 group-hover:text-base-content/70 group-hover:translate-x-0.5 transition-all duration-200 flex-shrink-0' />
31+ </ Link >
32+ </ SectionContainer >
5133 )
5234}
0 commit comments