wwf
2025-05-20 938c3e5a587ce950a94964ea509b9e7f8834dfae
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import React, { type FC } from 'react'
import type { YearAndMonthPickerHeaderProps } from '../types'
import { useMonths } from '../hooks'
import { RiArrowUpSLine } from '@remixicon/react'
 
const Header: FC<YearAndMonthPickerHeaderProps> = ({
  selectedYear,
  selectedMonth,
  onClick,
}) => {
  const months = useMonths()
 
  return (
    <div className='flex border-b-[0.5px] border-divider-regular p-2 pb-1'>
      {/* Year and Month */}
      <button
        onClick={onClick}
        className='system-md-semibold flex items-center gap-x-0.5 rounded-lg px-2 py-1.5 text-text-primary hover:bg-state-base-hover'
      >
        <span>{`${months[selectedMonth]} ${selectedYear}`}</span>
        <RiArrowUpSLine className='h-4 w-4 text-text-tertiary' />
      </button>
    </div>
  )
}
 
export default React.memo(Header)