jsketcher/web/app/sketcher/components/SketcherToolbar.jsx
2020-03-20 01:37:34 -07:00

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>;
}