File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
client/src/app/(main)/projects/[projectId] Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ export default function ProjectPage() {
79
79
const [ isAddPapersSheetOpen , setIsAddPapersSheetOpen ] = useState ( false ) ;
80
80
const [ addPapersView , setAddPapersView ] = useState < 'initial' | 'upload' | 'library' > ( 'initial' ) ;
81
81
const [ isUploadDialogOpen , setIsUploadDialogOpen ] = useState ( false ) ;
82
+ const [ showAllPapers , setShowAllPapers ] = useState ( false ) ;
82
83
const { subscription } = useSubscription ( ) ;
83
84
84
85
const chatDisabled = isChatCreditAtLimit ( subscription ) ;
@@ -647,11 +648,18 @@ export default function ProjectPage() {
647
648
648
649
{ papers && papers . length > 0 ? (
649
650
< div className = "grid grid-cols-1 gap-4" >
650
- { papers . map ( ( paper , index ) => (
651
+ { papers . slice ( 0 , showAllPapers ? papers . length : 7 ) . map ( ( paper , index ) => (
651
652
< div key = { paper . id } className = "animate-fade-in" style = { { animationDelay : `${ index * 100 } ms` } } >
652
653
< PaperCard paper = { paper } minimalist = { true } projectId = { projectId } onUnlink = { getProjectPapers } />
653
654
</ div >
654
655
) ) }
656
+ { papers . length > 7 && ! showAllPapers && (
657
+ < div className = "mt-4 text-center" >
658
+ < Button variant = "outline" onClick = { ( ) => setShowAllPapers ( true ) } >
659
+ Show More
660
+ </ Button >
661
+ </ div >
662
+ ) }
655
663
</ div >
656
664
) : (
657
665
< div className = "text-center p-8 border-dashed border-2 border-gray-300 rounded-xl bg-gray-50" >
You can’t perform that action at this time.
0 commit comments