
        <script setup>
        import { computed } from "vue"
        import { Example, PropsTable, PageTitle } from "@viteplay/vue"
        import { useRoute, useRouter } from "vue-router"
            
        let componentProps = {"WlIconText":[{"name":"name","type":"PropType<string>","required":false,"desc":"アイコン"},{"name":"p_Text","type":"PropType<string>","required":false,"desc":"表示テキスト"},{"name":"type","type":"PropType<'' | 'outlined' | 'sharp' | 'round' | 'two-tone'>","required":false,"desc":"Iconのtype"},{"name":"color","type":"PropType<'nomal' | 'primary' | 'secondary' | 'warning' | 'positive' | 'accent' | 'negative'>","required":false,"desc":"テキストのtype"}]}
        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%20setup%20lang=%22ts%22%3E%0Aimport%20WlIconText%20from%20'../WlIconText.vue'%0A%3C/script%3E%0A%0A%3Ctemplate%3E%0A%20%20%3CWlIconText%20name=%22mail%22%20color=%22accent%22%20p_Text=%22%E9%96%8B%E5%B0%81%E6%B8%88%E3%81%BF%22%20/%3E%0A%3C/template%3E%0A%0A%3Cstyle%20lang=%22sass%22%20scoped%3E%3C/style%3E"),
                iframeUrl: "/__iframe/WlIconText-basic.html",
                openInEditor: import.meta.env.DEV 
                  ? () => openInEditor("/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/WlIconText/examples/Basic.vue") 
                  : undefined 
              }
        ]
        </script>
        <template>
          <PageTitle title="WlIconText" :openInEditor="() => openInEditor('/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/WlIconText/WlIconText.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="WlIconText" :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>
      