function renderHtmlAttributes(attributes: Record): Record { const renderedAttributes: Record = {}; 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;