import { memo } from 'react'

import {
  PageTabs,
  type PageTabItem,
} from '../../../../shared/ui/PageTabs/PageTabs'

export type EmployeesSection = 'users' | 'organisations'

type EmployeesTabsProps = {
  activeSection: EmployeesSection
  onChange: (section: EmployeesSection) => void
}

const tabs: Array<PageTabItem<EmployeesSection>> = [
  {
    value: 'users',
    label: 'Пользователи',
  },
  {
    value: 'organisations',
    label: 'Организации',
  },
]

export const EmployeesTabs = memo(function EmployeesTabs({
  activeSection,
  onChange,
}: EmployeesTabsProps) {
  return (
    <PageTabs
      activeValue={activeSection}
      items={tabs}
      onChange={onChange}
    />
  )
})
