function renderHtmlAttributes(attributes: Record<string, string | string[]>): Record<string, string> {
	const renderedAttributes: Record<string, string> = {};

	for (let [attributeKey, attributeValues] of Object.entries(attributes)) {
		let values = attributeValues;

		if (Array.isArray(attributeValues)) {
			values = attributeValues.join(' ');
		}

		if (attributeKey === 'class') {
			attributeKey = 'className';
		}

		renderedAttributes[attributeKey] = String(values);
	}

	return renderedAttributes;
}

export default renderHtmlAttributes;
