remove unused imports
This commit is contained in:
parent
0f60a63a7d
commit
8d93f34f2a
5 changed files with 67 additions and 29 deletions
|
|
@ -13,7 +13,6 @@ import {
|
||||||
UtensilsCrossed,
|
UtensilsCrossed,
|
||||||
Bed,
|
Bed,
|
||||||
ShoppingBag,
|
ShoppingBag,
|
||||||
Wrench,
|
|
||||||
Car,
|
Car,
|
||||||
Ship,
|
Ship,
|
||||||
HelpCircle,
|
HelpCircle,
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,15 @@ import { useI18n } from 'vue-i18n'
|
||||||
import { Search } from 'lucide-vue-next'
|
import { Search } from 'lucide-vue-next'
|
||||||
import { Input } from '@/components/ui/input'
|
import { Input } from '@/components/ui/input'
|
||||||
import { Button } from '@/components/ui/button'
|
import { Button } from '@/components/ui/button'
|
||||||
|
import {
|
||||||
|
UtensilsCrossed,
|
||||||
|
Bed,
|
||||||
|
ShoppingBag,
|
||||||
|
Sparkles,
|
||||||
|
Car,
|
||||||
|
Ship,
|
||||||
|
HelpCircle,
|
||||||
|
} from 'lucide-vue-next'
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
|
|
@ -19,25 +28,45 @@ const emit = defineEmits<{
|
||||||
'update:town': [value: string]
|
'update:town': [value: string]
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
const categoryIcons = {
|
||||||
|
restaurant: UtensilsCrossed,
|
||||||
|
lodging: Bed,
|
||||||
|
goods: ShoppingBag,
|
||||||
|
services: Sparkles,
|
||||||
|
taxi: Car,
|
||||||
|
lancha: Ship,
|
||||||
|
other: HelpCircle,
|
||||||
|
} as const
|
||||||
|
|
||||||
|
const categoryColors = {
|
||||||
|
restaurant: 'text-orange-500',
|
||||||
|
lodging: 'text-purple-500',
|
||||||
|
goods: 'text-green-500',
|
||||||
|
services: 'text-pink-500',
|
||||||
|
taxi: 'text-yellow-500',
|
||||||
|
lancha: 'text-blue-500',
|
||||||
|
other: 'text-gray-500',
|
||||||
|
} as const
|
||||||
|
|
||||||
const categories = computed(() => [
|
const categories = computed(() => [
|
||||||
{ id: 'all', label: t('directory.categories.all') },
|
{ id: 'all', label: t('directory.categories.all') },
|
||||||
{ id: 'restaurant', label: t('directory.categories.restaurant') },
|
{ id: 'restaurant', label: t('directory.categories.restaurant'), icon: categoryIcons.restaurant },
|
||||||
{ id: 'lodging', label: t('directory.categories.lodging') },
|
{ id: 'lodging', label: t('directory.categories.lodging'), icon: categoryIcons.lodging },
|
||||||
{ id: 'goods', label: t('directory.categories.goods') },
|
{ id: 'goods', label: t('directory.categories.goods'), icon: categoryIcons.goods },
|
||||||
{ id: 'services', label: t('directory.categories.services') },
|
{ id: 'services', label: t('directory.categories.services'), icon: categoryIcons.services },
|
||||||
{ id: 'taxi', label: t('directory.categories.taxi') },
|
{ id: 'taxi', label: t('directory.categories.taxi'), icon: categoryIcons.taxi },
|
||||||
{ id: 'lancha', label: t('directory.categories.lancha') },
|
{ id: 'lancha', label: t('directory.categories.lancha'), icon: categoryIcons.lancha },
|
||||||
{ id: 'other', label: t('directory.categories.other') }
|
{ id: 'other', label: t('directory.categories.other'), icon: categoryIcons.other },
|
||||||
])
|
])
|
||||||
|
|
||||||
const towns = computed(() => [
|
const towns = computed(() => [
|
||||||
{ id: 'all', label: t('directory.towns.all') },
|
{ id: 'all', label: t('directory.towns.all') },
|
||||||
{ id: 'San Marcos', label: 'San Marcos' },
|
{ id: 'San Marcos', label: 'San Marcos' },
|
||||||
{ id: 'Tzununa', label: 'Tzununa' },
|
|
||||||
{ id: 'San Pablo', label: 'San Pablo' },
|
|
||||||
{ id: 'San Pedro', label: 'San Pedro' },
|
{ id: 'San Pedro', label: 'San Pedro' },
|
||||||
|
{ id: 'Tzununa', label: 'Tzununa' },
|
||||||
|
{ id: 'Jaibalito', label: 'Jaibalito' },
|
||||||
|
{ id: 'San Pablo', label: 'San Pablo' },
|
||||||
{ id: 'Panajachel', label: 'Panajachel' },
|
{ id: 'Panajachel', label: 'Panajachel' },
|
||||||
{ id: 'Jaibalito', label: 'Jaibalito' }
|
|
||||||
])
|
])
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -56,15 +85,33 @@ const towns = computed(() => [
|
||||||
<!-- Category Filter -->
|
<!-- Category Filter -->
|
||||||
<div class="flex gap-2 overflow-x-auto pb-2 md:pb-0">
|
<div class="flex gap-2 overflow-x-auto pb-2 md:pb-0">
|
||||||
<Button v-for="cat in categories" :key="cat.id" @click="emit('update:category', cat.id)"
|
<Button v-for="cat in categories" :key="cat.id" @click="emit('update:category', cat.id)"
|
||||||
:variant="category === cat.id ? 'default' : 'secondary'" size="sm" class="rounded-full">
|
:variant="category === cat.id ? 'default' : 'secondary'" size="sm" class="rounded-full whitespace-nowrap">
|
||||||
{{ cat.label }}
|
<!-- Show only icon on mobile for non-'all' categories -->
|
||||||
|
<template v-if="cat.id !== 'all'">
|
||||||
|
<component :is="cat.icon"
|
||||||
|
class="h-4 w-4 md:mr-2"
|
||||||
|
:class="[
|
||||||
|
category === cat.id ? '' : categoryColors[cat.id as keyof typeof categoryColors],
|
||||||
|
'md:hidden'
|
||||||
|
]"
|
||||||
|
/>
|
||||||
|
<component :is="cat.icon"
|
||||||
|
class="h-4 w-4 mr-2 hidden md:inline-block"
|
||||||
|
:class="category === cat.id ? '' : categoryColors[cat.id as keyof typeof categoryColors]"
|
||||||
|
/>
|
||||||
|
<span class="hidden md:inline">{{ cat.label }}</span>
|
||||||
|
</template>
|
||||||
|
<!-- Always show text for 'all' category -->
|
||||||
|
<template v-else>
|
||||||
|
{{ cat.label }}
|
||||||
|
</template>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Town Filter -->
|
<!-- Town Filter -->
|
||||||
<div class="flex gap-2 overflow-x-auto pb-2 md:pb-0">
|
<div class="flex gap-2 overflow-x-auto pb-2 md:pb-0">
|
||||||
<Button v-for="to in towns" :key="to.id" @click="emit('update:town', to.id)"
|
<Button v-for="to in towns" :key="to.id" @click="emit('update:town', to.id)"
|
||||||
:variant="town === to.id ? 'default' : 'secondary'" size="sm" class="rounded-full">
|
:variant="town === to.id ? 'default' : 'secondary'" size="sm" class="rounded-full whitespace-nowrap">
|
||||||
{{ to.label }}
|
{{ to.label }}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ import {
|
||||||
UtensilsCrossed,
|
UtensilsCrossed,
|
||||||
Bed,
|
Bed,
|
||||||
ShoppingBag,
|
ShoppingBag,
|
||||||
Wrench,
|
|
||||||
Car,
|
Car,
|
||||||
Ship,
|
Ship,
|
||||||
HelpCircle,
|
HelpCircle,
|
||||||
|
|
@ -85,12 +84,8 @@ const socialColors = {
|
||||||
<CardHeader>
|
<CardHeader>
|
||||||
<div class="space-y-2">
|
<div class="space-y-2">
|
||||||
<div class="flex items-center gap-4">
|
<div class="flex items-center gap-4">
|
||||||
<component
|
<component :is="categoryIcons[item.category]" class="h-8 w-8" :class="categoryColors[item.category]"
|
||||||
:is="categoryIcons[item.category]"
|
:title="t(`directory.categories.${item.category}`)" />
|
||||||
class="h-8 w-8"
|
|
||||||
:class="categoryColors[item.category]"
|
|
||||||
:title="t(`directory.categories.${item.category}`)"
|
|
||||||
/>
|
|
||||||
<CardTitle class="text-3xl">{{ item.name }}</CardTitle>
|
<CardTitle class="text-3xl">{{ item.name }}</CardTitle>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -122,14 +117,14 @@ const socialColors = {
|
||||||
<div class="space-y-2">
|
<div class="space-y-2">
|
||||||
<div>{{ item.contact }}</div>
|
<div>{{ item.contact }}</div>
|
||||||
<div v-if="item.contactType" class="flex gap-2">
|
<div v-if="item.contactType" class="flex gap-2">
|
||||||
<a v-if="item.contactType.includes('whatsapp')" :href="`https://wa.me/${item.contact.replace(/\D/g, '')}`"
|
<a v-if="item.contactType.includes('whatsapp')"
|
||||||
target="_blank" rel="noopener noreferrer"
|
:href="`https://wa.me/${item.contact.replace(/\D/g, '')}`" target="_blank" rel="noopener noreferrer"
|
||||||
class="inline-flex items-center gap-1.5 rounded-full bg-green-100 px-3 py-1 text-sm font-medium text-green-800 hover:bg-green-200 transition-colors">
|
class="inline-flex items-center gap-1.5 rounded-full bg-green-100 px-3 py-1 text-sm font-medium text-green-800 hover:bg-green-200 transition-colors">
|
||||||
<MessageCircle class="h-4 w-4" />
|
<MessageCircle class="h-4 w-4" />
|
||||||
WhatsApp
|
WhatsApp
|
||||||
</a>
|
</a>
|
||||||
<a v-if="item.contactType.includes('telegram')" :href="`https://t.me/${item.contact.replace(/\D/g, '')}`"
|
<a v-if="item.contactType.includes('telegram')"
|
||||||
target="_blank" rel="noopener noreferrer"
|
:href="`https://t.me/${item.contact.replace(/\D/g, '')}`" target="_blank" rel="noopener noreferrer"
|
||||||
class="inline-flex items-center gap-1.5 rounded-full bg-blue-100 px-3 py-1 text-sm font-medium text-blue-800 hover:bg-blue-200 transition-colors">
|
class="inline-flex items-center gap-1.5 rounded-full bg-blue-100 px-3 py-1 text-sm font-medium text-blue-800 hover:bg-blue-200 transition-colors">
|
||||||
<MessageCircle class="h-4 w-4" />
|
<MessageCircle class="h-4 w-4" />
|
||||||
Telegram
|
Telegram
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import DirectoryGrid from '@/components/directory/DirectoryGrid.vue'
|
import DirectoryGrid from '@/components/directory/DirectoryGrid.vue'
|
||||||
import { type DirectoryItem } from '@/types/directory'
|
|
||||||
import { mockDirectoryItems } from '@/data/directory'
|
import { mockDirectoryItems } from '@/data/directory'
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, computed } from 'vue'
|
import { ref, onMounted, computed } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import { Share2, Copy, Check } from 'lucide-vue-next'
|
import { Share2, Copy, Check } from 'lucide-vue-next'
|
||||||
import { Button } from '@/components/ui/button'
|
import { Button } from '@/components/ui/button'
|
||||||
|
|
@ -9,7 +8,6 @@ import { type DirectoryItem } from '@/types/directory'
|
||||||
import { mockDirectoryItems } from '@/data/directory'
|
import { mockDirectoryItems } from '@/data/directory'
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const router = useRouter()
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
id: string
|
id: string
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue