mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-09 09:52:34 +01:00
16 lines
556 B
JavaScript
16 lines
556 B
JavaScript
import React from 'react';
|
|
import ls from './SketcherToolbar.less';
|
|
import cx from 'classnames';
|
|
import {SketcherActionButton} from "./SketcherActionButton";
|
|
|
|
export function SketcherToolbar({actions, horizontal=false, compact}) {
|
|
|
|
return <div className={cx(ls[horizontal?'horizontal':'vertical'], ls.root, compact && ls.compact)}>
|
|
{actions.map((action, index) => {
|
|
if (action === '-') {
|
|
return <div key={index} className={ls.separator} />
|
|
}
|
|
return <SketcherActionButton key={action} actionId={action}/>
|
|
})}
|
|
</div>;
|
|
}
|