import {type Href} from 'expo-router'
import {View} from 'react-native'

import {SeeAllLink} from '@/components/see-all-link'
import {CardLabel} from '@/components/ui/card'
import {atoms as a} from '@/sprinkles'

// a labeled section header with a right-aligned "See all" link, shared by
// the home and profile feed previews
export const SectionHeader = ({
  label,
  seeAllHref,
  seeAllLabel,
}: {
  label: string
  seeAllHref: Href
  seeAllLabel: string
}) => (
  <View style={[a.flex_row, a.align_center, a.justify_between]}>
    <CardLabel>{label}</CardLabel>
    <SeeAllLink href={seeAllHref} label={seeAllLabel} />
  </View>
)
