import { useState } from 'react'

import { AnimationDirection, TabIndexProps } from './tabs.types'

export const useTabsState = (initialAnimation: AnimationDirection, tabIndex?: number) => {
  const [tabs, setTabs] = useState<TabIndexProps[]>([])
  const [activeTabIndex, setActiveTabIndex] = useState<number>(tabIndex ?? 0)
  const [animationDirection, setAnimationDirection] = useState<AnimationDirection>(initialAnimation)

  return { tabs, setTabs, activeTabIndex, setActiveTabIndex, animationDirection, setAnimationDirection }
}
