
        <script setup>
        import { computed } from "vue"
        import { Example, PropsTable, PageTitle } from "@viteplay/vue"
        import { useRoute, useRouter } from "vue-router"
            
        let componentProps = {"CTh":[{"name":"column","type":"BlitzColumn","desc":"The BlitzField object used for the columns","required":true},{"name":"sortState","type":"SortState","desc":"Currently only compatible with 1 column sorted","required":true}]}
        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"].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%20lang=%22ts%22%20setup%3E%0Aimport%20CTh%20from%20'../CTh.vue'%0Aimport%20%7B%20ref%20%7D%20from%20'vue'%0Aimport%20%7B%20SortState%20%7D%20from%20'@blitzar/types'%0A%0Aconst%20sortState%20=%20ref%3CSortState%3E(%5B%5D)%0A%3C/script%3E%0A%0A%3Ctemplate%3E%0A%20%20%3CCTh%20v-model:sortState=%22sortState%22%20:column=%22%7B%20id:%20'test',%20label:%20'%E3%83%86%E3%82%B9%E3%83%88',%20sortable:%20true%20%7D%22%20/%3E%0A%0A%20%20%3Cpre%3E%7B%7B%20sortState%20%7D%7D%3C/pre%3E%0A%3C/template%3E"),
                iframeUrl: "/__iframe/CTh-basic.html",
                openInEditor: import.meta.env.DEV 
                  ? () => openInEditor("/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CTh/examples/Basic.vue") 
                  : undefined 
              }
        ]
        </script>
        <template>
          <PageTitle title="CTh" :openInEditor="() => openInEditor('/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CTh/CTh.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="CTh" :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>
      