import {useLocalSearchParams} from 'expo-router'

import {FeedList} from '@/components/feed-list'
import {ModalListScreen} from '@/components/modal-list-screen'
import {usePagedListScreen} from '@/hooks/use-paged-list-screen'
import {profileActivity} from '@/stores/profile'

export default function ProfileActivityScreen() {
  const {userId} = useLocalSearchParams<{userId: string}>()
  const {items, loading, loadingMore, screenProps} =
    usePagedListScreen(profileActivity, userId)

  return (
    <ModalListScreen title="Activity" {...screenProps}>
      <FeedList
        items={items}
        loading={loading}
        loadingMore={loadingMore}
        emptyMessage="No activity yet"
        hideAuthor
      />
    </ModalListScreen>
  )
}
