// Haptics that silently no-op on web.
import * as Haptics from "expo-haptics";
import { Platform } from "react-native";

const canBuzz = Platform.OS !== "web";

export const haptic = {
  /** Light tick — captures, small confirmations. */
  tap: () => {
    if (canBuzz) void Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
  },
  /** Medium thunk — picking up a draggable. */
  pickup: () => {
    if (canBuzz) void Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium);
  },
  /** Success notification — completing a task, landing a drop. */
  success: () => {
    if (canBuzz) void Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
  },
  /** Selection change — flicking through chips. */
  select: () => {
    if (canBuzz) void Haptics.selectionAsync();
  },
};
