
        <script setup>
        import { computed } from "vue"
        import { Example, PropsTable, PageTitle } from "@viteplay/vue"
        import { useRoute, useRouter } from "vue-router"
            
        let componentProps = {"CModal":[{"name":"p_Fullscreen","type":"boolean","required":false,"desc":""},{"name":"modelValue","type":"boolean","required":true,"desc":""}]}
        let route = useRoute()
        let router = useRouter()
        let focusId = computed(() => route.query.focus && route.hash.slice(1))
        let shouldRender = (slug) => {
          return !route.query.focus || slug === focusId.value
        }
        let hiddenCount = computed(() => {
          return ["basic","image"].filter((slug) => !shouldRender(slug)).length
        })

        let showAll = () => {
          router.push({ query: {}, hash: route.hash })
        }

        let openInEditor = (file) => {
           fetch('/__open-in-editor?file=' + encodeURIComponent(file))
        }
        let examples = [
          {
                title: "Basic",
                slug: "basic",
                docs: {"content":"","attrs":{}},
                // encodeURI because the example will contain html tags
                // which will cause this component to be incorrectly parsed
                code: decodeURI("%3Cscript%20setup%3E%0Aimport%20%7B%20ref%20%7D%20from%20'vue'%0Aimport%20CModal%20from%20'../CModal.vue'%0A%0Aconst%20isOpen%20=%20ref(false)%0A%3C/script%3E%0A%0A%3Ctemplate%3E%0A%20%20%3Cbutton%20@click=%22isOpen%20=%20!isOpen%22%3Eopen%20modal%3C/button%3E%0A%20%20%3CCModal%20v-model=%22isOpen%22%20p_Title=%22My%20Modal%22%0A%20%20%20%20%3Etest%20test%20test%20test%20test%20test%20test%20test%20test%20test%0A%20%20%3C/CModal%3E%0A%3C/template%3E%0A%0A%3Cstyle%3E%0A:root%20%7B%0A%20%20--q-primary:%20goldenrod;%0A%7D%0A%3C/style%3E"),
                iframeUrl: "/__iframe/CModal-basic.html",
                openInEditor: import.meta.env.DEV 
                  ? () => openInEditor("/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CModal/examples/Basic.vue") 
                  : undefined 
              },{
                title: "Image",
                slug: "image",
                docs: {"content":"","attrs":{}},
                // encodeURI because the example will contain html tags
                // which will cause this component to be incorrectly parsed
                code: decodeURI("%3Cscript%20setup%3E%0Aimport%20%7B%20ref%20%7D%20from%20'vue'%0Aimport%20CModal%20from%20'../CModal.vue'%0A%0Aconst%20isOpen%20=%20ref(false)%0A%3C/script%3E%0A%0A%3Ctemplate%3E%0A%20%20%3Cbutton%20@click=%22isOpen%20=%20!isOpen%22%3Eopen%20modal%3C/button%3E%0A%20%20%3CCModal%20v-model=%22isOpen%22%20p_Title=%22%22%3E%0A%20%20%20%20%3Cdiv%20style=%22color:%20pink%22%3Etest%20test%20test%20test%20test%20test%20test%20test%20test%20test%3C/div%3E%3C/CModal%0A%20%20%3E%0A%3C/template%3E%0A%0A%3Cstyle%3E%0A:root%20%7B%0A%20%20--q-primary:%20goldenrod;%0A%7D%0A%3C/style%3E"),
                iframeUrl: "/__iframe/CModal-image.html",
                openInEditor: import.meta.env.DEV 
                  ? () => openInEditor("/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CModal/examples/Image.vue") 
                  : undefined 
              }
        ]
        </script>
        <template>
          <PageTitle title="CModal" :openInEditor="() => openInEditor('/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CModal/CModal.vue')" />
          <div v-if="hiddenCount > 0" class="hidden-examples-info">
            {{ hiddenCount }} example{{ hiddenCount > 1 ? "s" : null }} hidden, <a class="viteplay-link" type="button" @click.prevent="showAll">show all</a>
          </div>
          <PropsTable componentName="CModal" :componentProps="componentProps" />
          <template  
            v-for="example in examples" 
            :key="example.slug">
            <Example 
              v-if="shouldRender(example.slug)"
              :example="example" 
              :componentProps="componentProps" />
          </template>
        </template>

<style scoped>
.hidden-examples-info {
  margin: 20px 0;
}
</style>
      