import { isMobilePLPChatPlacementParameter } from '../guards/isMobilePLPChatPlacementParameter';
import { MobilePLPChatPlacementParameter } from '../mobilePLPChatPlacementParameter';

export const validateMobilePLPChatPlacementParameter = (
  value: unknown,
): MobilePLPChatPlacementParameter | undefined => {
  if (!isMobilePLPChatPlacementParameter(value)) {
    return undefined;
  }

  return {
    rowIndex: value.row_index,
  };
};
