import { Vibration } from 'react-native';

// Enhanced vibration patterns for scan feedback
export const playScanSound = async (type, enabled = true) => {
  if (!enabled) return;
  try {
    // Use Haptics as primary feedback (more reliable across devices)
    // Sound would require audio files which we don't have
    if (type === 'success') {
      Vibration.vibrate(70);
    } else if (type === 'already-picked') {
      Vibration.vibrate([0, 100, 50, 100]);
    } else if (type === 'not-found') {
      Vibration.vibrate(200);
    } else if (type === 'complete') {
      Vibration.vibrate([0, 100, 50, 100, 50, 150]);
    }
  } catch (e) {
    console.log('Sound/vibration error:', e);
  }
};
