import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";

export const useEntryScreenId = (entry?: ZappEntry): string | undefined => {
  const { contentTypes } = usePickFromState("contentTypes");

  if (!entry) {
    return;
  }

  const entryType = entry?.type?.value;
  const entryCustomScreenId = entry?.screen_type;

  return entryCustomScreenId || contentTypes?.[entryType]?.screen_id;
};
