<script setup lang="ts">
// Tiny abstract per-module glyph (soft geometric, not literal icons).
// Ported from landing-sections.jsx ModuleGlyph.
import { computed } from 'vue'
import { useTheme } from '~/composables/useLanding'

const props = defineProps<{ name: string }>()
const t = useTheme()
const stroke = 1.5

const kind = computed(() => {
  const n = props.name
  if (n === 'Mail' || n === 'mail') return 'mail'
  if (n === 'Drev' || n === 'Drive') return 'drive'
  if (n === 'Møder' || n === 'Meet') return 'meet'
  if (n === 'Chat') return 'chat'
  return 'identity'
})
</script>

<template>
  <svg width="36" height="36" viewBox="0 0 36 36">
    <template v-if="kind === 'mail'">
      <rect x="3" y="9" width="30" height="20" rx="2" fill="none" :stroke="t.fg" :stroke-width="stroke" />
      <path d="M3 11 L18 22 L33 11" fill="none" :stroke="t.fg" :stroke-width="stroke" />
      <circle cx="30" cy="9" r="3" :fill="t.signal" />
    </template>
    <template v-else-if="kind === 'drive'">
      <rect x="4" y="10" width="28" height="18" rx="2" fill="none" :stroke="t.fg" :stroke-width="stroke" />
      <path d="M4 14 L13 14 L16 10 L32 10" fill="none" :stroke="t.fg" :stroke-width="stroke" />
      <circle cx="18" cy="20" r="2.5" :fill="t.signal" />
    </template>
    <template v-else-if="kind === 'meet'">
      <rect x="3" y="10" width="22" height="16" rx="2" fill="none" :stroke="t.fg" :stroke-width="stroke" />
      <path d="M25 14 L33 10 L33 26 L25 22 Z" fill="none" :stroke="t.fg" :stroke-width="stroke" />
      <circle cx="14" cy="18" r="3" :fill="t.signal" />
    </template>
    <template v-else-if="kind === 'chat'">
      <path d="M5 6 L31 6 Q33 6 33 8 L33 22 Q33 24 31 24 L16 24 L9 30 L9 24 L7 24 Q5 24 5 22 Z" fill="none" :stroke="t.fg" :stroke-width="stroke" />
      <circle cx="14" cy="15" r="1.6" :fill="t.signal" />
      <circle cx="19" cy="15" r="1.6" :fill="t.fg" />
      <circle cx="24" cy="15" r="1.6" :fill="t.fg" />
    </template>
    <template v-else>
      <rect x="8" y="14" width="20" height="16" rx="2" fill="none" :stroke="t.fg" :stroke-width="stroke" />
      <path d="M12 14 V10 Q12 5 18 5 Q24 5 24 10 V14" fill="none" :stroke="t.fg" :stroke-width="stroke" />
      <circle cx="18" cy="22" r="2.5" :fill="t.signal" />
    </template>
  </svg>
</template>
