CodePanel.vue 978 B

12345678910111213141516171819202122232425262728293031
  1. <template>
  2. <div class="not-prose max-w-[40rem] mx-auto lg:ml-[calc(50%_-_min(50%,33rem))] lg:mr-[calc(50%_-_min(50%,33rem))] lg:max-w-[50rem] my-6 overflow-hidden rounded-2xl bg-zinc-900 shadow-md ring-1 ring-white/10">
  3. <div class="flex min-h-[calc(theme(spacing.12)+1px)] flex-wrap items-start gap-x-4 border-b px-4 border-zinc-800 bg-transparent">
  4. <h3 v-if="label != ''" class="mr-auto pt-3 text-xs font-semibold text-white">
  5. {{ label }}
  6. </h3>
  7. </div>
  8. <div class="group bg-white/2.5">
  9. <div class="relative overflow-x-auto p-4 text-xs text-white">
  10. <ContentSlot :use="$slots.default"/>
  11. <CopyButton :code="$slots.default()[0].props.code"/>
  12. </div>
  13. </div>
  14. </div>
  15. </template>
  16. <script setup>
  17. const props = defineProps({
  18. code: {
  19. return: ''
  20. },
  21. tag: {
  22. return: ''
  23. },
  24. label: {
  25. return: ''
  26. }
  27. })
  28. </script>