mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-14 23:28:34 +00:00
26 lines
606 B
JavaScript
26 lines
606 B
JavaScript
import { getClaviature } from 'claviature';
|
|
import React from 'react';
|
|
|
|
export default function Claviature({ options, onClick, onMouseDown, onMouseUp, onMouseLeave }) {
|
|
const svg = getClaviature({
|
|
options,
|
|
onClick,
|
|
onMouseDown,
|
|
onMouseUp,
|
|
onMouseLeave,
|
|
});
|
|
return (
|
|
<svg {...svg.attributes}>
|
|
{svg.children.map((el, i) => {
|
|
const TagName = el.name;
|
|
const { key, ...attributes } = el.attributes;
|
|
return (
|
|
<TagName key={`${el.name}-${i}`} {...attributes}>
|
|
{el.value}
|
|
</TagName>
|
|
);
|
|
})}
|
|
</svg>
|
|
);
|
|
}
|