<script lang="ts">
    import { onMount } from 'svelte'
    import { events } from '@rage-fw/shared'
    import { rpc } from '@/lib'

    let data = $state<string>('')

    onMount(() => {
        rpc.register(events.browser.customBrowserEvent, (args: string) => {
            data = data + ' | ' + args
            return 'response from cef'
        })
        rpc.callClient(events.client.cefReady, ['hello from cef'])
    })
</script>

<div style="width: '100%';color: 'white';text-align: 'center'">
    <h1>Hello World!</h1>
    <h2>{data}</h2>
</div>