import { type ItemLabel, itemLabel } from "@ax/constants";

/**
 * Determines the content kind label based on the content type flags.
 * @param isSimpleContentType - Whether the content is a simple content type
 * @param isPageContentType - Whether the content is a page content type
 * @param isStandardPage - Whether the content is a standard page
 * @returns The corresponding content kind label
 */
function getContentItemLabel({
	isSimpleContentType,
	isPageContentType,
	isStandardPage,
}: {
	isSimpleContentType: boolean;
	isPageContentType: boolean;
	isStandardPage: boolean;
}) {
	let contentItem: ItemLabel | null = null;

	if (isSimpleContentType) {
		contentItem = itemLabel.SIMPLE_CONTENT_TYPE;
	} else if (isPageContentType) {
		contentItem = itemLabel.PAGE_CONTENT_TYPE;
	} else if (isStandardPage) {
		contentItem = itemLabel.PAGE;
	} else {
		// fallback
		contentItem = itemLabel.ITEM;
	}

	return contentItem;
}

export { getContentItemLabel };
