   # However, this component really does read and write only to the 'undo'
   # part of the state bucket, and we have to get react to update somehow, and
   # we don't want the parent to have to worry about this, so it's in @state.
-  getState: -> {isEnabled: @props.lc.canUndo()}
+  getState: -> {
+    isEnabled: switch
+      when undoOrRedo == 'undo' then @props.lc.canUndo()
+      when undoOrRedo == 'redo' then @props.lc.canRedo()
+  }
   getInitialState: -> @getState()
   mixins: [LC.React.Mixins.UpdateOnDrawingChangeMixin]
 

    {div} = React.DOM
    {lc} = @props

    className = React.addons.classSet
      'lc-undo': true
      'toolbar-button': true
      'thin-button': true
      'disabled': not @state.isEnabled
    onClick = if lc.canUndo() then (=> lc.undo()) else ->

    (div {
      className, onClick,
      dangerouslySetInnerHTML: {__html: "&larr;"}})


LC.React.RedoButton = React.createClass
  displayName: 'RedoButton'
  getState: -> {isEnabled: @props.lc.canRedo()}
  getInitialState: -> @getState()
  mixins: [LC.React.Mixins.UpdateOnDrawingChangeMixin]

  render: ->
    {div} = React.DOM
    {lc} = @props

    className = React.addons.classSet
      'lc-redo': true
      'toolbar-button': true
      'thin-button': true
      'disabled': not @state.isEnabled
    onClick = if lc.canRedo() then (=> lc.redo()) else ->

    (div {
      className, onClick,
      dangerouslySetInnerHTML: {__html: "&rarr;"}})


createZoomButtonComponent = (inOrOut) -> React.createClass

      'toolbar-button': true
      'thin-button': true
      'disabled': not @state.isEnabled
    onClick = switch
      when !@state.isEnabled then ->
      when inOrOut == 'in' then -> lc.zoom(0.2)
      when inOrOut == 'out' then -> lc.zoom(-0.2)

    (div {className, onClick}, switch
      when inOrOut == 'in' then '+'
