const random = (arr) => {
	return arr[Math.floor(Math.random() * arr.length)];
};

///
const title = () => {
	return random(['Vino', 'Pepsi', 'Cigla', 'Kokakola', 'Somalirane Pufne za Frezenkovanje']);
};

const owner = () => {
	return random(['Radic.doo', 'Stefan Komerc', 'Indo grasa products', 'Piljar Manija', 'Impex promet']);
};

const city = () => {
	return random(['Nis', 'Novi Sad', 'Beograd', 'Valjevo', 'Kosovska Mitrovica']);
};

const quantity = () => {
	return random(['400', '30', '1000', '53', '111']);
};

const details = () => {
	return random(['Details for this product are very detailed yesyees'])
}
//

const size = () => {
	return random(['Extra Small', 'Small', 'Medium', 'Large', 'Extra Large']);
};

const color = () => {
	return random(['Red', 'Green', 'Blue', 'Orange', 'Yellow']);
};

const designer = () => {
	return random([
		'Ralph Lauren',
		'Alexander Wang',
		'Grayse',
		'Marc NY Performance',
		'Scrapbook',
		'J Brand Ready to Wear',
		'Vintage Havana',
		'Neiman Marcus Cashmere Collection',
		'Derek Lam 10 Crosby',
		'Jordan',
	]);
};

const type = () => {
	return random([
		'Cashmere',
		'Cardigans',
		'Crew and Scoop',
		'V-Neck',
		'Shoes',
		'Cowl & Turtleneck',
	]);
};

const price = () => {
	return (Math.random() * 100).toFixed(2);
};

function generate(count) {
	const data = [];
	for (let i = 0; i < count; i++) {
		const currentTitle = title();
		const currentOwner = owner();
		const currentCity = city();
		const currentQuantity= quantity();
		const currentDetails = details();

		data.push({
			title: currentTitle,
			owner: currentOwner,
			city: currentCity,
			quantity: currentQuantity,
			details: currentDetails,
		});
	}
	return data;
}

export default generate;
