import { ButtonGroup } from '@blueprintjs/core'
import Reloader from '@inject/graphql/components/Reloader'
import responsiveButtonGroup from '@inject/shared/css/responsiveButtonGroup'
import type { FC } from 'react'
import RemoveUsers from '../RemoveUsers'
import ResetCredentials from '../ResetCredentials'

interface OptionsProps {
  userId: string
  onRefetch: () => void
  onDelete: () => void
}

const Options: FC<OptionsProps> = ({ userId, onRefetch, onDelete }) => (
  <>
    <ButtonGroup minimal className={responsiveButtonGroup}>
      <ResetCredentials userIds={[userId]} />
      <RemoveUsers userIds={[userId]} onConfirm={onDelete} />
      <Reloader onRefetch={onRefetch} />
    </ButtonGroup>
  </>
)

export default Options
