import { Capacitor } from "@capacitor/core";

export function createPlatformRuntime(capacitor = Capacitor) {
  const platform = capacitor.getPlatform();

  return Object.freeze({
    platform,
    isNative: capacitor.isNativePlatform(),
    isAndroid: platform === "android",
    isIOS: platform === "ios"
  });
}

export const platformRuntime = createPlatformRuntime();
