export const API_URL = 'https://api.seals.id/api'; 
export const MEDIA_URL = 'https://api.seals.id/api/uploads'; 

export let headerSection = 'section'
export let headerTopic = 'topic'
export let headerLevel = 'level'

export const slugify = text => {
	if (!text) {
		return ''
	}

	return text
		.toString()
		.toLowerCase()
		.trim()
		.replace(/\s+/g, '-')
		.replace(/[^\w\-]+/g, '')
		.replace(/\-\-+/g, '-')
}

export const unSlugify = text => {
	if (!text) {
		return ''
	}

	return text
		.toString()
		.toLowerCase()
		.replace(/-/g, ' ')
		.replace(/\b\w/g, char => char.toUpperCase())
}

export const setReviewHeader = (section, topic, level) => {
	headerSection = section
	headerTopic = topic
	headerLevel = level
}
