             @setState
                 currentSubmit: undefined
                 currentDiff: newDiff
-
+    render:  () ->
+        SubmitComponent = @props.SubmitComponent
+        submitComponentProps = {@props..., @state...}
+        admin = @props.me?.admin
+        <Grid fluid>
+            <Col xs={12} sm={12} md={8} lg={8}>
+                {
+                if @state.currentSubmit
+                    <div>
+                        {`<SubmitComponent {...submitComponentProps}/>`}
+                    </div>
+                else if @state.currentDiff[1] and @state.currentDiff[0]
+                    if @state.currentDiff[1].source == @state.currentDiff[0].source
+                        <div>
+                            <SubmitHeader submit={@state.currentDiff[0]} admin={@props.me?.admin}/>
+                            <pre>Нет изменений</pre>
+                        </div>
+                    else
+                        diffText = JsDiff.createTwoFilesPatch(
+                            @state.currentDiff[1]._id,
+                            @state.currentDiff[0]._id,
+                            @state.currentDiff[1].sourceRaw,
+                            @state.currentDiff[0].sourceRaw)
+                        diffText = diffText.split("\n")
+                        diffText[0] = "diff --git a/#{@state.currentDiff[0]._id} b/#{@state.currentDiff[1]._id}\nindex aaaaaaa..aaaaaaa 100644"
+                        diffText = diffText.join("\n")
+                        files = parseDiff(diffText, {nearbySequences: "zip"})
+
+                        <div>
+                            <SubmitHeader submit={@state.currentDiff[0]} admin={admin}/>
+                            <pre>
+                                {files.map(({hunks}, i) => <Diff key={i} hunks={hunks} viewType="split"/>)}
+                            </pre>
+                        </div>
+                }
+            </Col>
+            <Col xs={12} sm={12} md={4} lg={4}>
+                <SubmitListTable
+                    submits={@props.submits}
+                    handleSubmitClick={@setCurrentSubmit}
+                    handleDiffClick={@setCurrentDiff}
+                    activeId={@state.currentSubmit?._id}
+                    activeDiffId={@state.currentDiff.map((submit)->submit?._id)}/>
+            </Col>
+        </Grid>
+
+export class ReviewResult extends React.Component
     paidStyle: () ->
         user = @props.user
         if (!user?.paidTill)

        @props.handleDone?()

    syncSetOutcome: (result) ->
        await callApi "setOutcome/#{@state.currentSubmit._id}", {
            result,
            comment: @state.commentText
        }
        @props.syncHandleDone?()
        @props.handleReload()

    componentDidUpdate: (prevProps, prevState) ->
        if prevProps.result._id != @props.result._id
            @setState
                commentText: ""
                currentSubmit: if @props.submits then @props.submits[@props.submits.length - 1] else null
                bestSubmits: @state.bestSubmits
                currentDiff: @state.currentDiff
        else
            newState =
                commentText: @state.commentText
                currentSubmit: null
                bestSubmits: @state.bestSubmits
                currentDiff: @state.currentDiff
            for submit in @props.submits
                if submit._id == @state.currentSubmit?._id
                    newState.currentSubmit = submit
            if not deepEqual(newState, @state)
                @setState(newState)

    downloadSubmits: () ->
        await callApi "downloadSubmitsForUserAndProblem/#{@props.user._id}/#{@props.result.fullTable._id}"
        @props.handleReload()

    comment: () ->
        @setResult(null)

    setQuality: (quality) ->
        () =>
            await callApi "setQuality/#{@props.currentSubmit._id}/#{quality}", {}
            @props.handleReload()

    toggleBestSubmits: (e) ->
