Files
2026-08-27 21:09:14 +00:00

19 lines
352 B
JavaScript

function Component(props) {
const label = <span>Label</span>;
if (props.type === 'link') {
const uri = createURI(props.id);
return (
<a
href={uri.toString()}
onClick={e => {
e.preventDefault();
uri.navigate();
}}>
{label}
</a>
);
} else {
return <>{label}</>;
}
}