import * as R from "ramda";

export const getIdProp = R.compose(encodeURIComponent, R.prop("id"));

export const getRiverId = R.cond([
  [R.has("riverId"), R.prop("riverId")],
  [R.has("screen_type"), R.prop("screen_type")],
  [R.T, getIdProp],
]);

export const getMenuItemId = R.path(["data", "target"]);

export const getArticleId = getIdProp;

export const getPlayableId = getIdProp;

export const getContentScreenId = getIdProp;

export const getUrlSchemeId = R.compose(encodeURIComponent, R.prop("url"));

export const getLinkId = R.compose(
  encodeURIComponent,
  R.path(["link", "href"])
);
