Skip to content

Self-hosted house planner: true-scale 2D floor plan, 3D, satellite map overlay, sewer, electrical, water and underfloor heating with calculations, priced bill of materials. React + PHP, no database. By the team behind homedesignsai.pro

686 B
Raw Blame
import type { HTMLAttributes } from 'react'
import { cx } from './cx'

export type ToolbarPlacement = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-center' | 'bottom-center'

type Props = HTMLAttributes<HTMLDivElement> & {
  placement?: ToolbarPlacement
  direction?: 'row' | 'column'
}

export function CanvasToolbar({ placement = 'top-left', direction = 'row', className, ...rest }: Props) {
  return (
    <div
      className={cx('card', 'canvas-toolbar', `canvas-toolbar--${placement}`, `canvas-toolbar--${direction}`, className)}
      {...rest}
    />
  )
}

export function ToolbarSeparator() {
  return <span className="canvas-toolbar__sep" aria-hidden />
}