<script lang="ts">
	import Composer from '$lib/core/Composer.svelte';

	let composer = {
		id: 'StateToStateContainer',
		layout: {
			rows: '1fr 1fr',
			areas: `
				"top"
                "bottom"
			`
		},
		children: [
			{
				id: 'ComposerBob',
				component: 'ComposerBob',
				slot: 'top',
				machine: {
					initial: 'READY',
					states: {
						NOTREADY: {
							on: { TOGGLE: 'READY' }
						},
						READY: {
							on: { TOGGLE: 'NOTREADY' }
						}
					}
				}
			},
			{
				id: 'ComposerAlice',
				component: 'ComposerAlice',
				slot: 'bottom',
				machine: {
					initial: 'RED',
					states: {
						GREEN: {
							on: { SWITCH: 'YELLOW' }
						},
						YELLOW: {
							on: { SWITCH: 'RED' }
						},
						RED: {
							on: { SWITCH: 'GREEN' }
						}
					},
					on: {
						READY: 'GREEN',
						NOTREADY: 'RED'
					}
				}
			}
		]
	};
</script>

<Composer {composer} />
