import { Platform } from "react-native";

export type PlatformType = "ios" | "android" | "web";

export const usePlatform = (): PlatformType => {
  return Platform.OS as PlatformType;
};

export const useIsIOS = (): boolean => {
  return Platform.OS === "ios";
};

export const useIsAndroid = (): boolean => {
  return Platform.OS === "android";
};

export const useIsWeb = (): boolean => {
  return Platform.OS === "web";
};

export const getPlatform = (): PlatformType => {
  return Platform.OS as PlatformType;
};
