import { Component } from '../../lib/vues6/vues6.js'

const template = `
<span>
    <coreid-profile-edit v-if="page === 'dash.profile'"></coreid-profile-edit>
    <coreid-app-setup v-if="page === 'app.setup'"></coreid-app-setup>
    <cobalt-form
        v-if="page === 'cobalt.form' && form_id"
        :resource="resource"
        :form_id="form_id"
        :initial_mode="mode"
    ></cobalt-form>
    <cobalt-form
        v-if="page === 'cobalt.form' && !form_id"
        :resource="resource"
        :initial_mode="mode"
    ></cobalt-form>
    <cobalt-listing
        v-if="page === 'cobalt.listing'"
        :resource="resource"
    ></cobalt-listing>
</span>
`
export default class RootPageComponent extends Component {
    static get selector() { return 'coreid-root' }
    static get template() { return template }
    static get props() { return ['page', 'form_id', 'resource', 'mode'] }

    constructor() {
        super()
    }
}
