'use client';

function vibrate(pattern: number | number[]): void {
  if (typeof navigator !== 'undefined' && navigator.vibrate) {
    navigator.vibrate(pattern);
  }
}

export function hapticTap() {
  vibrate(10);
}

export function hapticSuccess() {
  vibrate([10, 50, 10]);
}

export function hapticCelebration() {
  vibrate([10, 30, 10, 30, 50]);
}
