import React from 'react'
import { Box, Text } from 'ink'
import SelectInput from 'ink-select-input'

/**
 * Simple confirmation component using SelectInput
 */
const SimpleConfirm = ({ message, onConfirm }) => {
  const handleSelect = item => {
    onConfirm(item.value === 'yes')
  }

  const items = [
    { label: 'Yes', value: 'yes' },
    { label: 'No', value: 'no' },
  ]

  return (
    <Box flexDirection='column'>
      <Box marginBottom={1}>
        <Text color='yellow'>{message}</Text>
      </Box>
      <SelectInput items={items} onSelect={handleSelect} />
    </Box>
  )
}

export default SimpleConfirm