Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

1.0 KB
Raw Blame
import { useActions, useValues } from 'kea'

import { CanvasComposer } from './CanvasComposer'
import { canvasSceneLogic } from './canvasSceneLogic'
import { CanvasStartHero } from './CanvasStartHero'

/** The body of a canvas with nothing to render yet: the composer that starts its first build. */
export function CanvasEmptyBody({ notice }: { notice?: string }): JSX.Element {
    const { instruction, instructionFromSuggestion, generationStarting } = useValues(canvasSceneLogic)
    const { setInstruction, generateCanvas } = useActions(canvasSceneLogic)

    return (
        <CanvasStartHero description={notice ?? 'Describe it and an agent builds it.'}>
            <CanvasComposer
                instruction={instruction}
                onInstructionChange={setInstruction}
                onSubmit={() => generateCanvas(instruction, instructionFromSuggestion)}
                submitting={generationStarting}
                disabledReason={instruction.trim() ? null : 'Describe the canvas first'}
            />
        </CanvasStartHero>
    )
}