Compare commits
30 commits
d91b4a50d5
...
f62cb87445
| Author | SHA1 | Date | |
|---|---|---|---|
| f62cb87445 | |||
| 2e7319dcec | |||
| 012073c42f | |||
|
|
02482720fa | ||
|
|
a98454bfc3 | ||
|
|
f29646ddd7 | ||
|
|
bc81b44172 | ||
|
|
cdba64d246 | ||
|
|
1904a54131 | ||
|
|
09a1e3b9f6 | ||
|
|
5d44051898 | ||
|
|
2c4af6c2b5 | ||
|
|
7e5e782915 | ||
|
|
18cbf56a95 | ||
|
|
9f4445f716 | ||
|
|
7fd310da97 | ||
|
|
a5e64e40e8 | ||
|
|
1fb244a0a1 | ||
|
|
ab9bfb8f06 | ||
|
|
73b1f0e357 | ||
|
|
57d7c5709b | ||
|
|
2f36296c7f | ||
|
|
8f3d60fe47 | ||
| fb36caa0b2 | |||
| 4c62daf46c | |||
| 39a7dc2096 | |||
| 5ee8321029 | |||
| b7db9bba5a | |||
| 2ac584b1d6 | |||
| 721b13afc8 |
7 changed files with 828 additions and 501 deletions
|
|
@ -47,10 +47,14 @@
|
|||
<FormField v-slot="{ componentField }" name="currency">
|
||||
<FormItem>
|
||||
<FormLabel>Currency *</FormLabel>
|
||||
<Select :disabled="isCreating" v-bind="componentField">
|
||||
<Select
|
||||
:key="`currency-select-${availableCurrencies.length}`"
|
||||
:disabled="isCreating || isLoadingCurrencies"
|
||||
v-bind="componentField"
|
||||
>
|
||||
<FormControl>
|
||||
<SelectTrigger class="w-full">
|
||||
<SelectValue placeholder="Select currency" />
|
||||
<SelectValue :placeholder="isLoadingCurrencies ? 'Loading...' : 'Select currency'" />
|
||||
</SelectTrigger>
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
|
|
@ -275,6 +279,7 @@ const toast = useToast()
|
|||
// Local state
|
||||
const isCreating = ref(false)
|
||||
const createError = ref<string | null>(null)
|
||||
const isLoadingCurrencies = ref(false)
|
||||
const availableCurrencies = ref<string[]>(['sat'])
|
||||
const availableZones = ref<Zone[]>([])
|
||||
const showNewZoneForm = ref(false)
|
||||
|
|
@ -331,11 +336,27 @@ const onSubmit = form.handleSubmit(async (values) => {
|
|||
|
||||
// Methods
|
||||
const loadAvailableCurrencies = async () => {
|
||||
isLoadingCurrencies.value = true
|
||||
try {
|
||||
const currencies = await nostrmarketAPI.getCurrencies()
|
||||
availableCurrencies.value = currencies
|
||||
if (currencies.length > 0) {
|
||||
// Ensure 'sat' is always first in the list
|
||||
const satIndex = currencies.indexOf('sat')
|
||||
if (satIndex === -1) {
|
||||
// Add 'sat' at the beginning if not present
|
||||
availableCurrencies.value = ['sat', ...currencies]
|
||||
} else if (satIndex > 0) {
|
||||
// Move 'sat' to the beginning if present but not first
|
||||
const withoutSat = currencies.filter(c => c !== 'sat')
|
||||
availableCurrencies.value = ['sat', ...withoutSat]
|
||||
} else {
|
||||
availableCurrencies.value = currencies
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to load currencies:', error)
|
||||
} finally {
|
||||
isLoadingCurrencies.value = false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,77 +77,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Quick Actions -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<!-- Customer Actions -->
|
||||
<div class="bg-card p-6 rounded-lg border shadow-sm">
|
||||
<h3 class="text-lg font-semibold text-foreground mb-4 flex items-center gap-2">
|
||||
<ShoppingCart class="w-5 h-5 text-primary" />
|
||||
Customer Actions
|
||||
</h3>
|
||||
<div class="space-y-3">
|
||||
<Button
|
||||
@click="navigateToMarket"
|
||||
variant="default"
|
||||
class="w-full justify-start"
|
||||
>
|
||||
<Store class="w-4 h-4 mr-2" />
|
||||
Browse Market
|
||||
</Button>
|
||||
<Button
|
||||
@click="navigateToOrders"
|
||||
variant="outline"
|
||||
class="w-full justify-start"
|
||||
>
|
||||
<Package class="w-4 h-4 mr-2" />
|
||||
View All Orders
|
||||
</Button>
|
||||
<Button
|
||||
@click="navigateToCart"
|
||||
variant="outline"
|
||||
class="w-full justify-start"
|
||||
>
|
||||
<ShoppingCart class="w-4 h-4 mr-2" />
|
||||
Shopping Cart
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Merchant Actions -->
|
||||
<div class="bg-card p-6 rounded-lg border shadow-sm">
|
||||
<h3 class="text-lg font-semibold text-foreground mb-4 flex items-center gap-2">
|
||||
<Store class="w-5 h-5 text-green-500" />
|
||||
Merchant Actions
|
||||
</h3>
|
||||
<div class="space-y-3">
|
||||
<Button
|
||||
@click="navigateToStore"
|
||||
variant="default"
|
||||
class="w-full justify-start"
|
||||
>
|
||||
<Store class="w-4 h-4 mr-2" />
|
||||
Manage Store
|
||||
</Button>
|
||||
<Button
|
||||
@click="navigateToProducts"
|
||||
variant="outline"
|
||||
class="w-full justify-start"
|
||||
>
|
||||
<Package class="w-4 h-4 mr-2" />
|
||||
Manage Products
|
||||
</Button>
|
||||
<Button
|
||||
@click="navigateToOrders"
|
||||
variant="outline"
|
||||
class="w-full justify-start"
|
||||
>
|
||||
<Package class="w-4 h-4 mr-2" />
|
||||
View Orders
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Recent Activity -->
|
||||
<div class="bg-card p-6 rounded-lg border shadow-sm">
|
||||
<h3 class="text-lg font-semibold text-foreground mb-4">Recent Activity</h3>
|
||||
|
|
@ -216,15 +145,12 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useAuth } from '@/composables/useAuthService'
|
||||
import { useMarket } from '../composables/useMarket'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import {
|
||||
Package,
|
||||
Store,
|
||||
ShoppingCart,
|
||||
DollarSign,
|
||||
BarChart3,
|
||||
Clock
|
||||
|
|
@ -233,7 +159,6 @@ import type { OrderApiResponse, NostrmarketAPI } from '../services/nostrmarketAP
|
|||
import { injectService, SERVICE_TOKENS } from '@/core/di-container'
|
||||
import type { PaymentService } from '@/core/services/PaymentService'
|
||||
|
||||
const router = useRouter()
|
||||
const auth = useAuth()
|
||||
const { isConnected } = useMarket()
|
||||
const nostrmarketAPI = injectService(SERVICE_TOKENS.NOSTRMARKET_API) as NostrmarketAPI
|
||||
|
|
@ -341,12 +266,6 @@ const getActivityVariant = (type: string) => {
|
|||
}
|
||||
}
|
||||
|
||||
const navigateToMarket = () => router.push('/market')
|
||||
const navigateToOrders = () => router.push('/market-dashboard?tab=orders')
|
||||
const navigateToCart = () => router.push('/cart')
|
||||
const navigateToStore = () => router.push('/market-dashboard?tab=store')
|
||||
const navigateToProducts = () => router.push('/market-dashboard?tab=store')
|
||||
|
||||
// Load orders when component mounts
|
||||
onMounted(() => {
|
||||
fetchOrders()
|
||||
|
|
|
|||
|
|
@ -2,331 +2,518 @@
|
|||
<div class="space-y-6">
|
||||
<!-- Header -->
|
||||
<div>
|
||||
<h2 class="text-2xl font-bold text-foreground">Market Settings</h2>
|
||||
<p class="text-muted-foreground mt-1">Configure your store and market preferences</p>
|
||||
<h2 class="text-2xl font-bold text-foreground">Store Settings</h2>
|
||||
<p class="text-muted-foreground mt-1">Configure your store information</p>
|
||||
</div>
|
||||
|
||||
<!-- Settings Tabs -->
|
||||
<div class="border-b border-border">
|
||||
<nav class="flex space-x-8">
|
||||
<button
|
||||
v-for="tab in settingsTabs"
|
||||
:key="tab.id"
|
||||
@click="activeSettingsTab = tab.id"
|
||||
:class="[
|
||||
'py-2 px-1 border-b-2 font-medium text-sm transition-colors',
|
||||
activeSettingsTab === tab.id
|
||||
? 'border-primary text-primary'
|
||||
: 'border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground'
|
||||
]"
|
||||
>
|
||||
{{ tab.name }}
|
||||
</button>
|
||||
</nav>
|
||||
<!-- Loading State -->
|
||||
<div v-if="isLoading" class="flex justify-center py-12">
|
||||
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-primary"></div>
|
||||
</div>
|
||||
|
||||
<!-- Settings Content -->
|
||||
<div class="min-h-[500px]">
|
||||
<!-- Store Settings Tab -->
|
||||
<div v-if="activeSettingsTab === 'store'" class="space-y-6">
|
||||
<div class="bg-card p-6 rounded-lg border shadow-sm">
|
||||
<h3 class="text-lg font-semibold text-foreground mb-4">Store Information</h3>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-foreground mb-2">Store Name</label>
|
||||
<Input v-model="storeSettings.name" placeholder="Enter store name" />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-foreground mb-2">Store Description</label>
|
||||
<Input v-model="storeSettings.description" placeholder="Enter store description" />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-foreground mb-2">Contact Email</label>
|
||||
<Input v-model="storeSettings.contactEmail" type="email" placeholder="Enter contact email" />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-foreground mb-2">Store Category</label>
|
||||
<select v-model="storeSettings.category" class="w-full px-3 py-2 border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring focus:border-ring bg-background text-foreground">
|
||||
<option value="">Select category</option>
|
||||
<option value="electronics">Electronics</option>
|
||||
<option value="clothing">Clothing</option>
|
||||
<option value="books">Books</option>
|
||||
<option value="food">Food & Beverages</option>
|
||||
<option value="services">Services</option>
|
||||
<option value="other">Other</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-6">
|
||||
<Button @click="saveStoreSettings" variant="default">
|
||||
Save Store Settings
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- No Store State -->
|
||||
<div v-else-if="!currentStall" class="text-center py-12">
|
||||
<div class="w-16 h-16 bg-muted rounded-full flex items-center justify-center mx-auto mb-4">
|
||||
<Store class="w-8 h-8 text-muted-foreground" />
|
||||
</div>
|
||||
<h3 class="text-lg font-medium text-foreground mb-2">No Store Found</h3>
|
||||
<p class="text-muted-foreground">
|
||||
Create a store first to manage its settings
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Payment Settings Tab -->
|
||||
<div v-else-if="activeSettingsTab === 'payment'" class="space-y-6">
|
||||
<div class="bg-card p-6 rounded-lg border shadow-sm">
|
||||
<h3 class="text-lg font-semibold text-foreground mb-4">Payment Configuration</h3>
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-foreground mb-2">Default Currency</label>
|
||||
<select v-model="paymentSettings.defaultCurrency" class="w-full px-3 py-2 border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring focus:border-ring bg-background text-foreground">
|
||||
<option value="sat">Satoshi (sats)</option>
|
||||
<option value="btc">Bitcoin (BTC)</option>
|
||||
<option value="usd">US Dollar (USD)</option>
|
||||
<option value="eur">Euro (EUR)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-foreground mb-2">Invoice Expiry (minutes)</label>
|
||||
<Input v-model="paymentSettings.invoiceExpiry" type="number" min="5" max="1440" placeholder="60" />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-foreground mb-2">Auto-generate Invoices</label>
|
||||
<div class="flex items-center">
|
||||
<input
|
||||
v-model="paymentSettings.autoGenerateInvoices"
|
||||
type="checkbox"
|
||||
class="h-4 w-4 text-primary focus:ring-primary border-input rounded"
|
||||
<!-- Store Settings Form -->
|
||||
<div v-else class="space-y-6">
|
||||
<!-- Store Information -->
|
||||
<div class="bg-card p-6 rounded-lg border shadow-sm">
|
||||
<h3 class="text-lg font-semibold text-foreground mb-4">Store Information</h3>
|
||||
<form @submit="onSubmit" class="space-y-4">
|
||||
<FormField v-slot="{ componentField }" name="name">
|
||||
<FormItem>
|
||||
<FormLabel>Store Name *</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
placeholder="Enter store name"
|
||||
:disabled="isSaving"
|
||||
v-bind="componentField"
|
||||
/>
|
||||
<label class="ml-2 text-sm text-foreground">
|
||||
Automatically generate Lightning invoices for new orders
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
</FormField>
|
||||
|
||||
<FormField v-slot="{ componentField }" name="description">
|
||||
<FormItem>
|
||||
<FormLabel>Description</FormLabel>
|
||||
<FormControl>
|
||||
<Textarea
|
||||
placeholder="Describe your store and what you sell"
|
||||
:disabled="isSaving"
|
||||
v-bind="componentField"
|
||||
rows="3"
|
||||
/>
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
This description will be shown to customers browsing your store
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
</FormField>
|
||||
|
||||
<FormField v-slot="{ componentField }" name="imageUrl">
|
||||
<FormItem>
|
||||
<FormLabel>Store Image URL</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
placeholder="https://example.com/store-image.jpg"
|
||||
:disabled="isSaving"
|
||||
v-bind="componentField"
|
||||
/>
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Optional image to represent your store
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
</FormField>
|
||||
|
||||
<!-- Read-only Currency Field -->
|
||||
<div class="pt-4 border-t">
|
||||
<label class="block text-sm font-medium text-muted-foreground mb-1">Currency</label>
|
||||
<div class="text-foreground">{{ currentStall.currency }}</div>
|
||||
<p class="text-xs text-muted-foreground mt-1">Currency is set when the store is created and cannot be changed</p>
|
||||
</div>
|
||||
<div class="mt-6">
|
||||
<Button @click="savePaymentSettings" variant="default">
|
||||
Save Payment Settings
|
||||
|
||||
<div class="pt-4">
|
||||
<Button type="submit" :disabled="isSaving || !isFormValid">
|
||||
<span v-if="isSaving">Saving...</span>
|
||||
<span v-else>Save Changes</span>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Nostr Settings Tab -->
|
||||
<div v-else-if="activeSettingsTab === 'nostr'" class="space-y-6">
|
||||
<div class="bg-card p-6 rounded-lg border shadow-sm">
|
||||
<h3 class="text-lg font-semibold text-foreground mb-4">Nostr Network Configuration</h3>
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-foreground mb-2">Relay Connections</label>
|
||||
<div class="space-y-2">
|
||||
<div v-for="relay in nostrSettings.relays" :key="relay" class="flex items-center gap-2">
|
||||
<Input :value="relay" readonly class="flex-1" />
|
||||
<Button @click="removeRelay(relay)" variant="outline" size="sm">
|
||||
<X class="w-4 h-4" />
|
||||
</Button>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<Input v-model="newRelay" placeholder="wss://relay.example.com" class="flex-1" />
|
||||
<Button @click="addRelay" variant="outline">
|
||||
Add Relay
|
||||
</Button>
|
||||
</div>
|
||||
<!-- Shipping Zones Section -->
|
||||
<div class="bg-card p-6 rounded-lg border shadow-sm">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<div>
|
||||
<h3 class="text-lg font-semibold text-foreground">Shipping Zones</h3>
|
||||
<p class="text-sm text-muted-foreground">Configure where you ship and the associated costs</p>
|
||||
</div>
|
||||
<Button
|
||||
v-if="!showAddZoneForm"
|
||||
@click="showAddZoneForm = true"
|
||||
size="sm"
|
||||
:disabled="isZoneLoading"
|
||||
>
|
||||
<Plus class="w-4 h-4 mr-2" />
|
||||
Add Zone
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<!-- Add Zone Form -->
|
||||
<div v-if="showAddZoneForm" class="mb-6 p-4 bg-muted/50 rounded-lg border">
|
||||
<h4 class="font-medium text-foreground mb-4">{{ editingZone ? 'Edit Zone' : 'Add New Zone' }}</h4>
|
||||
<form @submit.prevent="saveZone" class="space-y-4">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-foreground mb-1">Zone Name *</label>
|
||||
<Input
|
||||
v-model="zoneForm.name"
|
||||
placeholder="e.g., Domestic, International"
|
||||
:disabled="isZoneSaving"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-foreground mb-1">Shipping Cost *</label>
|
||||
<Input
|
||||
v-model.number="zoneForm.cost"
|
||||
type="number"
|
||||
min="0"
|
||||
step="0.01"
|
||||
placeholder="0"
|
||||
:disabled="isZoneSaving"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-foreground mb-2">Nostr Public Key</label>
|
||||
<Input :value="nostrSettings.pubkey" readonly class="font-mono text-sm" />
|
||||
<p class="text-xs text-muted-foreground mt-1">Your Nostr public key for receiving orders</p>
|
||||
<label class="block text-sm font-medium text-foreground mb-1">Countries/Regions</label>
|
||||
<Input
|
||||
v-model="zoneForm.countriesInput"
|
||||
placeholder="e.g., USA, Canada, Mexico (comma-separated)"
|
||||
:disabled="isZoneSaving"
|
||||
/>
|
||||
<p class="text-xs text-muted-foreground mt-1">Comma-separated list of countries or regions this zone covers</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-foreground mb-2">Connection Status</label>
|
||||
<div class="flex items-center gap-2">
|
||||
<div
|
||||
class="w-3 h-3 rounded-full"
|
||||
:class="orderEvents.isSubscribed ? 'bg-green-500' : 'bg-yellow-500'"
|
||||
></div>
|
||||
<span class="text-sm text-muted-foreground">
|
||||
{{ orderEvents.isSubscribed ? 'Connected to Nostr network' : 'Connecting to Nostr network...' }}
|
||||
|
||||
<div class="flex gap-2">
|
||||
<Button type="submit" :disabled="isZoneSaving || !isZoneFormValid" size="sm">
|
||||
<span v-if="isZoneSaving">Saving...</span>
|
||||
<span v-else>{{ editingZone ? 'Update Zone' : 'Add Zone' }}</span>
|
||||
</Button>
|
||||
<Button type="button" variant="outline" @click="cancelZoneForm" size="sm" :disabled="isZoneSaving">
|
||||
Cancel
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Zones List -->
|
||||
<div v-if="isZoneLoading" class="flex justify-center py-8">
|
||||
<div class="animate-spin rounded-full h-6 w-6 border-b-2 border-primary"></div>
|
||||
</div>
|
||||
|
||||
<div v-else-if="zones.length === 0 && !showAddZoneForm" class="text-center py-8 text-muted-foreground">
|
||||
<Truck class="w-12 h-12 mx-auto mb-3 opacity-50" />
|
||||
<p>No shipping zones configured</p>
|
||||
<p class="text-sm">Add a shipping zone to enable shipping for your products</p>
|
||||
</div>
|
||||
|
||||
<div v-else class="space-y-3">
|
||||
<div
|
||||
v-for="zone in zones"
|
||||
:key="zone.id"
|
||||
class="flex items-center justify-between p-4 bg-muted/30 rounded-lg border"
|
||||
>
|
||||
<div class="flex-1">
|
||||
<div class="font-medium text-foreground">{{ zone.name }}</div>
|
||||
<div class="text-sm text-muted-foreground">
|
||||
<span>{{ formatCost(zone.cost) }} {{ zone.currency }}</span>
|
||||
<span v-if="zone.countries?.length" class="ml-2">
|
||||
· {{ zone.countries.join(', ') }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-6">
|
||||
<Button @click="saveNostrSettings" variant="default">
|
||||
Save Nostr Settings
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Shipping Settings Tab -->
|
||||
<div v-else-if="activeSettingsTab === 'shipping'" class="space-y-6">
|
||||
<div class="bg-card p-6 rounded-lg border shadow-sm">
|
||||
<h3 class="text-lg font-semibold text-foreground mb-4">Shipping Zones</h3>
|
||||
<div class="space-y-4">
|
||||
<div v-for="zone in shippingSettings.zones" :key="zone.id" class="border border-border rounded-lg p-4">
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-foreground mb-1">Zone Name</label>
|
||||
<Input v-model="zone.name" placeholder="Zone name" />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-foreground mb-1">Cost</label>
|
||||
<Input v-model="zone.cost" type="number" min="0" step="0.01" placeholder="0.00" />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-foreground mb-1">Currency</label>
|
||||
<select v-model="zone.currency" class="w-full px-3 py-2 border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring focus:border-ring bg-background text-foreground">
|
||||
<option value="sat">Satoshi (sats)</option>
|
||||
<option value="btc">Bitcoin (BTC)</option>
|
||||
<option value="usd">US Dollar (USD)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-3 flex justify-end">
|
||||
<Button @click="removeShippingZone(zone.id)" variant="outline" size="sm">
|
||||
Remove Zone
|
||||
</Button>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
@click="editZone(zone)"
|
||||
:disabled="isZoneSaving"
|
||||
>
|
||||
<Pencil class="w-4 h-4" />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
@click="confirmDeleteZone(zone)"
|
||||
:disabled="isZoneSaving"
|
||||
class="text-destructive hover:text-destructive"
|
||||
>
|
||||
<Trash2 class="w-4 h-4" />
|
||||
</Button>
|
||||
</div>
|
||||
<Button @click="addShippingZone" variant="outline">
|
||||
<Plus class="w-4 h-4 mr-2" />
|
||||
Add Shipping Zone
|
||||
</Button>
|
||||
</div>
|
||||
<div class="mt-6">
|
||||
<Button @click="saveShippingSettings" variant="default">
|
||||
Save Shipping Settings
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Delete Zone Confirmation Dialog -->
|
||||
<Dialog :open="showDeleteConfirm" @update:open="showDeleteConfirm = $event">
|
||||
<DialogContent>
|
||||
<DialogHeader>
|
||||
<DialogTitle>Delete Shipping Zone</DialogTitle>
|
||||
<DialogDescription>
|
||||
Are you sure you want to delete "{{ zoneToDelete?.name }}"?
|
||||
This action cannot be undone.
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<DialogFooter>
|
||||
<Button variant="outline" @click="showDeleteConfirm = false" :disabled="isZoneSaving">
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
@click="deleteZone"
|
||||
:disabled="isZoneSaving"
|
||||
variant="destructive"
|
||||
>
|
||||
<span v-if="isZoneSaving">Deleting...</span>
|
||||
<span v-else>Delete</span>
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue'
|
||||
// import { useOrderEvents } from '@/composables/useOrderEvents' // TODO: Move to market module
|
||||
import { ref, computed, onMounted, watch } from 'vue'
|
||||
import { useForm } from 'vee-validate'
|
||||
import { toTypedSchema } from '@vee-validate/zod'
|
||||
import * as z from 'zod'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Input } from '@/components/ui/input'
|
||||
import { Plus, X } from 'lucide-vue-next'
|
||||
import { Textarea } from '@/components/ui/textarea'
|
||||
import {
|
||||
FormControl,
|
||||
FormDescription,
|
||||
FormField,
|
||||
FormItem,
|
||||
FormLabel,
|
||||
FormMessage,
|
||||
} from '@/components/ui/form'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@/components/ui/dialog'
|
||||
import { Store, Plus, Pencil, Trash2, Truck } from 'lucide-vue-next'
|
||||
import { injectService, SERVICE_TOKENS } from '@/core/di-container'
|
||||
import type { NostrmarketAPI, Stall, Zone } from '../services/nostrmarketAPI'
|
||||
import { auth } from '@/composables/useAuthService'
|
||||
import { useToast } from '@/core/composables/useToast'
|
||||
|
||||
// const marketStore = useMarketStore()
|
||||
// const orderEvents = useOrderEvents() // TODO: Move to market module
|
||||
const orderEvents = { isSubscribed: ref(false) } // Temporary mock
|
||||
// Services
|
||||
const nostrmarketAPI = injectService(SERVICE_TOKENS.NOSTRMARKET_API) as NostrmarketAPI
|
||||
const paymentService = injectService(SERVICE_TOKENS.PAYMENT_SERVICE) as any
|
||||
const toast = useToast()
|
||||
|
||||
// Local state
|
||||
const activeSettingsTab = ref('store')
|
||||
const newRelay = ref('')
|
||||
// State
|
||||
const isLoading = ref(true)
|
||||
const isSaving = ref(false)
|
||||
const currentStall = ref<Stall | null>(null)
|
||||
|
||||
// Settings data
|
||||
const storeSettings = ref({
|
||||
name: 'My Store',
|
||||
description: 'A great place to shop',
|
||||
contactEmail: 'store@example.com',
|
||||
category: 'other'
|
||||
// Zone state
|
||||
const zones = ref<Zone[]>([])
|
||||
const isZoneLoading = ref(false)
|
||||
const isZoneSaving = ref(false)
|
||||
const showAddZoneForm = ref(false)
|
||||
const editingZone = ref<Zone | null>(null)
|
||||
const showDeleteConfirm = ref(false)
|
||||
const zoneToDelete = ref<Zone | null>(null)
|
||||
|
||||
// Zone form
|
||||
const zoneForm = ref({
|
||||
name: '',
|
||||
cost: 0,
|
||||
countriesInput: ''
|
||||
})
|
||||
|
||||
const paymentSettings = ref({
|
||||
defaultCurrency: 'sat',
|
||||
invoiceExpiry: 60,
|
||||
autoGenerateInvoices: true
|
||||
const isZoneFormValid = computed(() => {
|
||||
return zoneForm.value.name.trim().length > 0 && zoneForm.value.cost >= 0
|
||||
})
|
||||
|
||||
const nostrSettings = ref({
|
||||
relays: [
|
||||
'wss://relay.damus.io',
|
||||
'wss://relay.snort.social',
|
||||
'wss://nostr-pub.wellorder.net'
|
||||
],
|
||||
pubkey: 'npub1...' // TODO: Get from auth
|
||||
// Form schema - only fields that exist in the Stall model
|
||||
const formSchema = toTypedSchema(z.object({
|
||||
name: z.string().min(1, "Store name is required").max(100, "Store name must be less than 100 characters"),
|
||||
description: z.string().max(500, "Description must be less than 500 characters").optional(),
|
||||
imageUrl: z.string().url("Must be a valid URL").optional().or(z.literal(''))
|
||||
}))
|
||||
|
||||
// Form setup
|
||||
const form = useForm({
|
||||
validationSchema: formSchema,
|
||||
initialValues: {
|
||||
name: '',
|
||||
description: '',
|
||||
imageUrl: ''
|
||||
}
|
||||
})
|
||||
|
||||
const shippingSettings = ref({
|
||||
zones: [
|
||||
{
|
||||
id: '1',
|
||||
name: 'Local',
|
||||
cost: 0,
|
||||
currency: 'sat',
|
||||
estimatedDays: '1-2 days'
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name: 'Domestic',
|
||||
cost: 1000,
|
||||
currency: 'sat',
|
||||
estimatedDays: '3-5 days'
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
name: 'International',
|
||||
cost: 5000,
|
||||
currency: 'sat',
|
||||
estimatedDays: '7-14 days'
|
||||
const { resetForm, meta } = form
|
||||
const isFormValid = computed(() => meta.value.valid)
|
||||
|
||||
// Format cost for display
|
||||
const formatCost = (cost: number) => {
|
||||
return cost === 0 ? 'Free' : cost.toString()
|
||||
}
|
||||
|
||||
// Load store data
|
||||
const loadStoreData = async () => {
|
||||
const currentUser = auth.currentUser?.value
|
||||
if (!currentUser?.wallets?.length) {
|
||||
isLoading.value = false
|
||||
return
|
||||
}
|
||||
|
||||
const inkey = paymentService.getPreferredWalletInvoiceKey()
|
||||
if (!inkey) {
|
||||
isLoading.value = false
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
const stalls = await nostrmarketAPI.getStalls(inkey)
|
||||
if (stalls && stalls.length > 0) {
|
||||
currentStall.value = stalls[0]
|
||||
|
||||
// Update form with current values
|
||||
resetForm({
|
||||
values: {
|
||||
name: stalls[0].name || '',
|
||||
description: stalls[0].config?.description || '',
|
||||
imageUrl: stalls[0].config?.image_url || ''
|
||||
}
|
||||
})
|
||||
|
||||
// Load zones
|
||||
await loadZones()
|
||||
}
|
||||
]
|
||||
} catch (error) {
|
||||
console.error('Failed to load store data:', error)
|
||||
toast.error('Failed to load store settings')
|
||||
} finally {
|
||||
isLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// Load shipping zones
|
||||
const loadZones = async () => {
|
||||
const inkey = paymentService.getPreferredWalletInvoiceKey()
|
||||
if (!inkey) return
|
||||
|
||||
isZoneLoading.value = true
|
||||
try {
|
||||
zones.value = await nostrmarketAPI.getZones(inkey)
|
||||
} catch (error) {
|
||||
console.error('Failed to load zones:', error)
|
||||
toast.error('Failed to load shipping zones')
|
||||
} finally {
|
||||
isZoneLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// Save store settings
|
||||
const onSubmit = form.handleSubmit(async (values) => {
|
||||
if (!currentStall.value?.id) return
|
||||
|
||||
isSaving.value = true
|
||||
|
||||
try {
|
||||
const adminKey = paymentService.getPreferredWalletAdminKey()
|
||||
if (!adminKey) {
|
||||
throw new Error('No wallet admin key available')
|
||||
}
|
||||
|
||||
// Update the stall with new values
|
||||
const updatedStall = await nostrmarketAPI.updateStall(adminKey, currentStall.value.id, {
|
||||
name: values.name,
|
||||
config: {
|
||||
description: values.description || '',
|
||||
image_url: values.imageUrl || undefined
|
||||
}
|
||||
})
|
||||
|
||||
currentStall.value = updatedStall
|
||||
toast.success('Store settings saved successfully!')
|
||||
} catch (error) {
|
||||
console.error('Failed to save store settings:', error)
|
||||
toast.error('Failed to save store settings')
|
||||
} finally {
|
||||
isSaving.value = false
|
||||
}
|
||||
})
|
||||
|
||||
// Settings tabs
|
||||
const settingsTabs = [
|
||||
{ id: 'store', name: 'Store Settings' },
|
||||
{ id: 'payment', name: 'Payment Settings' },
|
||||
{ id: 'nostr', name: 'Nostr Network' },
|
||||
{ id: 'shipping', name: 'Shipping Zones' }
|
||||
]
|
||||
|
||||
// Methods
|
||||
const saveStoreSettings = () => {
|
||||
// TODO: Save store settings
|
||||
console.log('Saving store settings:', storeSettings.value)
|
||||
}
|
||||
|
||||
const savePaymentSettings = () => {
|
||||
// TODO: Save payment settings
|
||||
console.log('Saving payment settings:', paymentSettings.value)
|
||||
}
|
||||
|
||||
const saveNostrSettings = () => {
|
||||
// TODO: Save Nostr settings
|
||||
console.log('Saving Nostr settings:', nostrSettings.value)
|
||||
}
|
||||
|
||||
const saveShippingSettings = () => {
|
||||
// TODO: Save shipping settings
|
||||
console.log('Saving shipping settings:', shippingSettings.value)
|
||||
}
|
||||
|
||||
const addRelay = () => {
|
||||
if (newRelay.value && !nostrSettings.value.relays.includes(newRelay.value)) {
|
||||
nostrSettings.value.relays.push(newRelay.value)
|
||||
newRelay.value = ''
|
||||
}
|
||||
}
|
||||
|
||||
const removeRelay = (relay: string) => {
|
||||
const index = nostrSettings.value.relays.indexOf(relay)
|
||||
if (index > -1) {
|
||||
nostrSettings.value.relays.splice(index, 1)
|
||||
}
|
||||
}
|
||||
|
||||
const addShippingZone = () => {
|
||||
const newZone = {
|
||||
id: Date.now().toString(),
|
||||
name: 'New Zone',
|
||||
// Zone form functions
|
||||
const resetZoneForm = () => {
|
||||
zoneForm.value = {
|
||||
name: '',
|
||||
cost: 0,
|
||||
currency: 'sat',
|
||||
estimatedDays: '3-5 days'
|
||||
countriesInput: ''
|
||||
}
|
||||
shippingSettings.value.zones.push(newZone)
|
||||
editingZone.value = null
|
||||
showAddZoneForm.value = false
|
||||
}
|
||||
|
||||
const removeShippingZone = (zoneId: string) => {
|
||||
const index = shippingSettings.value.zones.findIndex(z => z.id === zoneId)
|
||||
if (index > -1) {
|
||||
shippingSettings.value.zones.splice(index, 1)
|
||||
const cancelZoneForm = () => {
|
||||
resetZoneForm()
|
||||
}
|
||||
|
||||
const editZone = (zone: Zone) => {
|
||||
editingZone.value = zone
|
||||
zoneForm.value = {
|
||||
name: zone.name,
|
||||
cost: zone.cost,
|
||||
countriesInput: zone.countries?.join(', ') || ''
|
||||
}
|
||||
showAddZoneForm.value = true
|
||||
}
|
||||
|
||||
const saveZone = async () => {
|
||||
const adminKey = paymentService.getPreferredWalletAdminKey()
|
||||
if (!adminKey || !currentStall.value) return
|
||||
|
||||
isZoneSaving.value = true
|
||||
|
||||
try {
|
||||
const countries = zoneForm.value.countriesInput
|
||||
.split(',')
|
||||
.map(c => c.trim())
|
||||
.filter(c => c.length > 0)
|
||||
|
||||
const zoneData: Zone = {
|
||||
id: editingZone.value?.id || '',
|
||||
name: zoneForm.value.name.trim(),
|
||||
currency: currentStall.value.currency,
|
||||
cost: zoneForm.value.cost,
|
||||
countries
|
||||
}
|
||||
|
||||
if (editingZone.value) {
|
||||
// Update existing zone
|
||||
await nostrmarketAPI.updateZone(adminKey, editingZone.value.id, zoneData)
|
||||
toast.success('Shipping zone updated!')
|
||||
} else {
|
||||
// Create new zone
|
||||
await nostrmarketAPI.createZone(adminKey, {
|
||||
name: zoneData.name,
|
||||
currency: zoneData.currency,
|
||||
cost: zoneData.cost,
|
||||
countries: zoneData.countries
|
||||
})
|
||||
toast.success('Shipping zone added!')
|
||||
}
|
||||
|
||||
// Reload zones and reset form
|
||||
await loadZones()
|
||||
resetZoneForm()
|
||||
} catch (error) {
|
||||
console.error('Failed to save zone:', error)
|
||||
toast.error(editingZone.value ? 'Failed to update zone' : 'Failed to add zone')
|
||||
} finally {
|
||||
isZoneSaving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// Lifecycle
|
||||
onMounted(() => {
|
||||
console.log('Market Settings component loaded')
|
||||
const confirmDeleteZone = (zone: Zone) => {
|
||||
zoneToDelete.value = zone
|
||||
showDeleteConfirm.value = true
|
||||
}
|
||||
|
||||
const deleteZone = async () => {
|
||||
const adminKey = paymentService.getPreferredWalletAdminKey()
|
||||
if (!adminKey || !zoneToDelete.value) return
|
||||
|
||||
isZoneSaving.value = true
|
||||
|
||||
try {
|
||||
await nostrmarketAPI.deleteZone(adminKey, zoneToDelete.value.id)
|
||||
toast.success('Shipping zone deleted!')
|
||||
await loadZones()
|
||||
} catch (error) {
|
||||
console.error('Failed to delete zone:', error)
|
||||
toast.error('Failed to delete zone')
|
||||
} finally {
|
||||
isZoneSaving.value = false
|
||||
showDeleteConfirm.value = false
|
||||
zoneToDelete.value = null
|
||||
}
|
||||
}
|
||||
|
||||
// Watch for auth changes
|
||||
watch(() => auth.currentUser?.value?.pubkey, async (newPubkey, oldPubkey) => {
|
||||
if (newPubkey !== oldPubkey) {
|
||||
isLoading.value = true
|
||||
await loadStoreData()
|
||||
}
|
||||
})
|
||||
|
||||
// Initialize
|
||||
onMounted(async () => {
|
||||
await loadStoreData()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -49,84 +49,47 @@
|
|||
|
||||
<!-- Stores Grid (shown when merchant profile exists) -->
|
||||
<div v-else>
|
||||
<!-- Header Section -->
|
||||
<div class="mb-8">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div>
|
||||
<h2 class="text-2xl font-bold text-foreground">My Stores</h2>
|
||||
<p class="text-muted-foreground mt-1">
|
||||
Manage your stores and products
|
||||
</p>
|
||||
<!-- Loading State for Stalls -->
|
||||
<div v-if="isLoadingStalls" class="flex justify-center py-12">
|
||||
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-primary"></div>
|
||||
</div>
|
||||
|
||||
<!-- No Store - Create First Store -->
|
||||
<div v-else-if="userStalls.length === 0" class="flex flex-col items-center justify-center py-12">
|
||||
<div class="w-24 h-24 bg-muted rounded-full flex items-center justify-center mb-6">
|
||||
<Store class="w-12 h-12 text-muted-foreground" />
|
||||
</div>
|
||||
<Button @click="navigateToMarket" variant="outline">
|
||||
<Store class="w-4 h-4 mr-2" />
|
||||
Browse Market
|
||||
<h2 class="text-2xl font-bold text-foreground mb-2">Create Your Store</h2>
|
||||
<p class="text-muted-foreground text-center mb-6 max-w-md">
|
||||
Set up your store to start selling products on the Nostr marketplace.
|
||||
</p>
|
||||
<Button
|
||||
@click="showCreateStoreDialog = true"
|
||||
variant="default"
|
||||
size="lg"
|
||||
>
|
||||
<Plus class="w-5 h-5 mr-2" />
|
||||
Create Store
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Loading State for Stalls -->
|
||||
<div v-if="isLoadingStalls" class="flex justify-center py-12">
|
||||
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-primary"></div>
|
||||
</div>
|
||||
|
||||
<!-- Stores Cards Grid -->
|
||||
<div v-else class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mb-8">
|
||||
<!-- Existing Store Cards -->
|
||||
<StoreCard
|
||||
v-for="stall in userStalls"
|
||||
:key="stall.id"
|
||||
:stall="stall"
|
||||
@manage="manageStall"
|
||||
@view-products="viewStallProducts"
|
||||
/>
|
||||
|
||||
<!-- Create New Store Card -->
|
||||
<div class="bg-card rounded-lg border-2 border-dashed border-muted-foreground/25 hover:border-primary/50 transition-colors">
|
||||
<button
|
||||
@click="showCreateStoreDialog = true"
|
||||
class="w-full h-full p-6 flex flex-col items-center justify-center min-h-[200px] hover:bg-muted/30 transition-colors"
|
||||
>
|
||||
<div class="w-12 h-12 bg-primary/10 rounded-full flex items-center justify-center mb-3">
|
||||
<Plus class="w-6 h-6 text-primary" />
|
||||
</div>
|
||||
<h3 class="text-lg font-semibold text-foreground mb-1">Create New Store</h3>
|
||||
<p class="text-sm text-muted-foreground text-center">
|
||||
Add another store to expand your marketplace presence
|
||||
</p>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Active Store Dashboard (shown when a store is selected) -->
|
||||
<div v-if="activeStall">
|
||||
<!-- Active Store Dashboard (shown when user has a store) -->
|
||||
<div v-else-if="activeStall">
|
||||
<!-- Header -->
|
||||
<div class="space-y-4 mb-6">
|
||||
<!-- Top row with back button and currency -->
|
||||
<div class="flex items-center gap-3">
|
||||
<Button @click="activeStallId = null" variant="ghost" size="sm">
|
||||
← Back to Stores
|
||||
</Button>
|
||||
<div class="h-4 w-px bg-border"></div>
|
||||
<Badge variant="secondary">{{ activeStall.currency }}</Badge>
|
||||
</div>
|
||||
|
||||
<!-- Store info and actions -->
|
||||
<div class="flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4">
|
||||
<div class="flex-1">
|
||||
<h2 class="text-xl sm:text-2xl font-bold text-foreground">{{ activeStall.name }}</h2>
|
||||
<p class="text-sm sm:text-base text-muted-foreground mt-1">{{ activeStall.config?.description || 'Manage incoming orders and your products' }}</p>
|
||||
</div>
|
||||
<div class="flex flex-col sm:flex-row gap-2 sm:gap-3">
|
||||
<Button @click="navigateToMarket" variant="outline" class="w-full sm:w-auto">
|
||||
<Store class="w-4 h-4 mr-2" />
|
||||
<span class="sm:inline">Browse Market</span>
|
||||
</Button>
|
||||
<Button @click="showCreateProductDialog = true" variant="default" class="w-full sm:w-auto">
|
||||
<Plus class="w-4 h-4 mr-2" />
|
||||
<span>Add Product</span>
|
||||
</Button>
|
||||
<div class="flex items-center gap-3 mb-1">
|
||||
<h2 class="text-xl sm:text-2xl font-bold text-foreground">{{ activeStall.name }}</h2>
|
||||
<Badge variant="secondary">{{ activeStall.currency }}</Badge>
|
||||
</div>
|
||||
<p class="text-sm sm:text-base text-muted-foreground">{{ activeStall.config?.description || 'Manage incoming orders and your products' }}</p>
|
||||
</div>
|
||||
<Button @click="navigateToMarket" variant="outline" class="w-full sm:w-auto">
|
||||
<Store class="w-4 h-4 mr-2" />
|
||||
<span class="sm:inline">Browse Market</span>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -188,20 +151,23 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Customer Satisfaction -->
|
||||
<div class="bg-card p-4 sm:p-6 rounded-lg border shadow-sm">
|
||||
<!-- Customer Satisfaction (Coming Soon) -->
|
||||
<div class="bg-card p-4 sm:p-6 rounded-lg border shadow-sm opacity-50 relative">
|
||||
<div class="absolute top-2 right-2">
|
||||
<Badge variant="outline" class="text-xs">Coming Soon</Badge>
|
||||
</div>
|
||||
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2">
|
||||
<div class="flex-1">
|
||||
<p class="text-xs sm:text-sm font-medium text-muted-foreground">Satisfaction</p>
|
||||
<p class="text-xl sm:text-2xl font-bold text-foreground">{{ storeStats.satisfaction }}%</p>
|
||||
<p class="text-xl sm:text-2xl font-bold text-muted-foreground">--%</p>
|
||||
</div>
|
||||
<div class="w-10 h-10 sm:w-12 sm:h-12 bg-yellow-500/10 rounded-lg flex items-center justify-center flex-shrink-0">
|
||||
<Star class="w-5 h-5 sm:w-6 sm:h-6 text-yellow-500" />
|
||||
<div class="w-10 h-10 sm:w-12 sm:h-12 bg-muted rounded-lg flex items-center justify-center flex-shrink-0">
|
||||
<Star class="w-5 h-5 sm:w-6 sm:h-6 text-muted-foreground" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-3 sm:mt-4">
|
||||
<div class="flex items-center text-xs sm:text-sm text-muted-foreground">
|
||||
<span>{{ storeStats.totalReviews }} reviews</span>
|
||||
<span>No reviews yet</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -430,7 +396,6 @@ import { injectService, SERVICE_TOKENS } from '@/core/di-container'
|
|||
import CreateStoreDialog from './CreateStoreDialog.vue'
|
||||
import CreateProductDialog from './CreateProductDialog.vue'
|
||||
import DeleteConfirmDialog from './DeleteConfirmDialog.vue'
|
||||
import StoreCard from './StoreCard.vue'
|
||||
import MerchantOrders from './MerchantOrders.vue'
|
||||
|
||||
const router = useRouter()
|
||||
|
|
@ -652,14 +617,6 @@ const loadStallProducts = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
const manageStall = (stallId: string) => {
|
||||
activeStallId.value = stallId
|
||||
}
|
||||
|
||||
const viewStallProducts = (stallId: string) => {
|
||||
activeStallId.value = stallId
|
||||
}
|
||||
|
||||
const navigateToMarket = () => router.push('/market')
|
||||
|
||||
const checkMerchantProfile = async () => {
|
||||
|
|
@ -697,7 +654,6 @@ const checkMerchantProfile = async () => {
|
|||
// Event handlers
|
||||
const onStoreCreated = async (_stall: Stall) => {
|
||||
await loadStallsList()
|
||||
toast.success('Store created successfully!')
|
||||
}
|
||||
|
||||
const onProductCreated = async (_product: Product) => {
|
||||
|
|
|
|||
|
|
@ -212,19 +212,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Debug Information (Development Only) -->
|
||||
<div v-if="isDevelopment" class="mt-8 p-4 bg-gray-100 rounded-lg">
|
||||
<h4 class="font-medium mb-2">Debug Information</h4>
|
||||
<div class="text-sm space-y-1">
|
||||
<div>Total Orders in Store: {{ Object.keys(marketStore.orders).length }}</div>
|
||||
<div>Filtered Orders: {{ filteredOrders.length }}</div>
|
||||
<div>Order Events Subscribed: {{ orderEvents.isSubscribed ? 'Yes' : 'No' }}</div>
|
||||
<div>Relay Hub Connected: {{ relayHub.isConnected ? 'Yes' : 'No' }}</div>
|
||||
<div>Auth Status: {{ auth.isAuthenticated ? 'Authenticated' : 'Not Authenticated' }}</div>
|
||||
<div>Current User: {{ auth.currentUser?.value?.pubkey ? 'Yes' : 'No' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Empty State -->
|
||||
<div v-else class="text-center py-12">
|
||||
<div class="w-16 h-16 bg-muted rounded-full flex items-center justify-center mx-auto mb-4">
|
||||
|
|
@ -312,8 +299,6 @@ const pendingOrders = computed(() => allOrders.value.filter(o => o.status === 'p
|
|||
const paidOrders = computed(() => allOrders.value.filter(o => o.status === 'paid').length)
|
||||
const pendingPayments = computed(() => allOrders.value.filter(o => !isOrderPaid(o)).length)
|
||||
|
||||
const isDevelopment = computed(() => import.meta.env.DEV)
|
||||
|
||||
// Methods
|
||||
const isOrderPaid = (order: any) => {
|
||||
// Prioritize the 'paid' field from Nostr status updates (type 2)
|
||||
|
|
@ -497,34 +482,9 @@ onMounted(() => {
|
|||
paymentService.forceResetPaymentState()
|
||||
}
|
||||
|
||||
// Orders are already loaded in the market store
|
||||
console.log('Order History component loaded with', allOrders.value.length, 'orders')
|
||||
console.log('Market store orders:', marketStore.orders)
|
||||
|
||||
// Debug: Log order details for orders with payment requests
|
||||
allOrders.value.forEach(order => {
|
||||
if (order.paymentRequest) {
|
||||
console.log('Order with payment request:', {
|
||||
id: order.id,
|
||||
paymentRequest: order.paymentRequest.substring(0, 50) + '...',
|
||||
hasPaymentRequest: !!order.paymentRequest,
|
||||
status: order.status,
|
||||
paymentStatus: order.paymentStatus
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
console.log('Order events status:', orderEvents.isSubscribed.value)
|
||||
console.log('Relay hub connected:', relayHub.isConnected.value)
|
||||
console.log('Auth status:', auth.isAuthenticated)
|
||||
console.log('Current user:', auth.currentUser?.value?.pubkey)
|
||||
|
||||
// Start listening for order events if not already listening
|
||||
if (!orderEvents.isSubscribed.value) {
|
||||
console.log('Starting order events listener...')
|
||||
orderEvents.initialize()
|
||||
} else {
|
||||
console.log('Order events already listening')
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -329,6 +329,34 @@ export class NostrmarketAPI extends BaseService {
|
|||
return stall
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an existing stall
|
||||
*/
|
||||
async updateStall(
|
||||
walletAdminkey: string,
|
||||
stallId: string,
|
||||
stallData: Partial<{
|
||||
name: string
|
||||
config: {
|
||||
description?: string
|
||||
image_url?: string
|
||||
}
|
||||
}>
|
||||
): Promise<Stall> {
|
||||
const stall = await this.request<Stall>(
|
||||
`/api/v1/stall/${stallId}`,
|
||||
walletAdminkey,
|
||||
{
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify(stallData),
|
||||
}
|
||||
)
|
||||
|
||||
this.debug('Updated stall:', { stallId: stall.id, stallName: stall.name })
|
||||
|
||||
return stall
|
||||
}
|
||||
|
||||
/**
|
||||
* Get available shipping zones
|
||||
*/
|
||||
|
|
@ -371,30 +399,70 @@ export class NostrmarketAPI extends BaseService {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get available currencies
|
||||
* Update an existing shipping zone
|
||||
*/
|
||||
async updateZone(
|
||||
walletAdminkey: string,
|
||||
zoneId: string,
|
||||
zoneData: Zone
|
||||
): Promise<Zone> {
|
||||
const zone = await this.request<Zone>(
|
||||
`/api/v1/zone/${zoneId}`,
|
||||
walletAdminkey,
|
||||
{
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify(zoneData),
|
||||
}
|
||||
)
|
||||
|
||||
this.debug('Updated zone:', { zoneId: zone.id, zoneName: zone.name })
|
||||
|
||||
return zone
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a shipping zone
|
||||
*/
|
||||
async deleteZone(walletAdminkey: string, zoneId: string): Promise<void> {
|
||||
await this.request<void>(
|
||||
`/api/v1/zone/${zoneId}`,
|
||||
walletAdminkey,
|
||||
{ method: 'DELETE' }
|
||||
)
|
||||
|
||||
this.debug('Deleted zone:', { zoneId })
|
||||
}
|
||||
|
||||
/**
|
||||
* Get available currencies from the LNbits core API
|
||||
* This endpoint returns currencies allowed by the server configuration
|
||||
*/
|
||||
async getCurrencies(): Promise<string[]> {
|
||||
const baseCurrencies = ['sat']
|
||||
// Call the LNbits core API directly (not under /nostrmarket)
|
||||
const url = `${this.baseUrl}/api/v1/currencies`
|
||||
|
||||
try {
|
||||
const apiCurrencies = await this.request<string[]>(
|
||||
'/api/v1/currencies',
|
||||
'', // No authentication needed for currencies endpoint
|
||||
{ method: 'GET' }
|
||||
)
|
||||
const response = await fetch(url, {
|
||||
method: 'GET',
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
})
|
||||
|
||||
if (apiCurrencies && Array.isArray(apiCurrencies)) {
|
||||
// Combine base currencies with API currencies, removing duplicates
|
||||
const allCurrencies = [...baseCurrencies, ...apiCurrencies.filter(currency => !baseCurrencies.includes(currency))]
|
||||
this.debug('Retrieved currencies:', { count: allCurrencies.length, currencies: allCurrencies })
|
||||
return allCurrencies
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to fetch currencies: ${response.status}`)
|
||||
}
|
||||
|
||||
this.debug('No API currencies returned, using base currencies only')
|
||||
return baseCurrencies
|
||||
const apiCurrencies = await response.json()
|
||||
|
||||
if (apiCurrencies && Array.isArray(apiCurrencies)) {
|
||||
this.debug('Retrieved currencies from LNbits core:', { count: apiCurrencies.length, currencies: apiCurrencies })
|
||||
return apiCurrencies
|
||||
}
|
||||
|
||||
this.debug('No currencies returned from server, using default')
|
||||
return ['sat']
|
||||
} catch (error) {
|
||||
this.debug('Failed to get currencies, falling back to base currencies:', error)
|
||||
return baseCurrencies
|
||||
this.debug('Failed to get currencies, using default:', error)
|
||||
return ['sat']
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
216
target-ui.md
Normal file
216
target-ui.md
Normal file
|
|
@ -0,0 +1,216 @@
|
|||
<template>
|
||||
<!--
|
||||
This example requires updating your template:
|
||||
|
||||
```
|
||||
<html class="h-full bg-white dark:bg-gray-900">
|
||||
<body class="h-full">
|
||||
```
|
||||
-->
|
||||
<div>
|
||||
<TransitionRoot as="template" :show="sidebarOpen">
|
||||
<Dialog class="relative z-50 lg:hidden" @close="sidebarOpen = false">
|
||||
<TransitionChild as="template" enter="transition-opacity ease-linear duration-300" enter-from="opacity-0" enter-to="" leave="transition-opacity ease-linear duration-300" leave-from="" leave-to="opacity-0">
|
||||
<div class="fixed inset-0 bg-gray-900/80"></div>
|
||||
</TransitionChild>
|
||||
|
||||
<div class="fixed inset-0 flex">
|
||||
<TransitionChild as="template" enter="transition ease-in-out duration-300 transform" enter-from="-translate-x-full" enter-to="translate-x-0" leave="transition ease-in-out duration-300 transform" leave-from="translate-x-0" leave-to="-translate-x-full">
|
||||
<DialogPanel class="relative mr-16 flex w-full max-w-xs flex-1">
|
||||
<TransitionChild as="template" enter="ease-in-out duration-300" enter-from="opacity-0" enter-to="" leave="ease-in-out duration-300" leave-from="" leave-to="opacity-0">
|
||||
<div class="absolute left-full top-0 flex w-16 justify-center pt-5">
|
||||
<button type="button" class="-m-2.5 p-2.5" @click="sidebarOpen = false">
|
||||
<span class="sr-only">Close sidebar</span>
|
||||
<XMarkIcon class="size-6 text-white" aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
</TransitionChild>
|
||||
|
||||
<!-- Sidebar component, swap this element with another sidebar if you like -->
|
||||
<div class="relative flex grow flex-col gap-y-5 overflow-y-auto bg-white px-6 pb-4 dark:bg-gray-900 dark:ring dark:ring-white/10 dark:before:pointer-events-none dark:before:absolute dark:before:inset-0 dark:before:bg-black/10">
|
||||
<div class="relative flex h-16 shrink-0 items-center">
|
||||
<img class="h-8 w-auto dark:hidden" src="https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=600" alt="Your Company" />
|
||||
<img class="hidden h-8 w-auto dark:block" src="https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=500" alt="Your Company" />
|
||||
</div>
|
||||
<nav class="relative flex flex-1 flex-col">
|
||||
<ul role="list" class="flex flex-1 flex-col gap-y-7">
|
||||
<li>
|
||||
<ul role="list" class="-mx-2 space-y-1">
|
||||
<li v-for="item in navigation" :key="item.name">
|
||||
<a :href="item.href" :class="[item.current ? 'bg-gray-50 text-indigo-600 dark:bg-white/5 dark:text-white' : 'text-gray-700 hover:bg-gray-50 hover:text-indigo-600 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-white', 'group flex gap-x-3 rounded-md p-2 text-sm/6 font-semibold']">
|
||||
<component :is="item.icon" :class="[item.current ? 'text-indigo-600 dark:text-white' : 'text-gray-400 group-hover:text-indigo-600 dark:group-hover:text-white', 'size-6 shrink-0']" aria-hidden="true" />
|
||||
{{ item.name }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<div class="text-xs/6 font-semibold text-gray-400">Your teams</div>
|
||||
<ul role="list" class="-mx-2 mt-2 space-y-1">
|
||||
<li v-for="team in teams" :key="team.name">
|
||||
<a :href="team.href" :class="[team.current ? 'bg-gray-50 text-indigo-600 dark:bg-white/5 dark:text-white' : 'text-gray-700 hover:bg-gray-50 hover:text-indigo-600 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-white', 'group flex gap-x-3 rounded-md p-2 text-sm/6 font-semibold']">
|
||||
<span :class="[team.current ? 'border-indigo-600 text-indigo-600 dark:border-white/20 dark:text-white' : 'border-gray-200 text-gray-400 group-hover:border-indigo-600 group-hover:text-indigo-600 dark:border-white/10 dark:group-hover:border-white/20 dark:group-hover:text-white', 'flex size-6 shrink-0 items-center justify-center rounded-lg border bg-white text-[0.625rem] font-medium dark:bg-white/5']">{{ team.initial }}</span>
|
||||
<span class="truncate">{{ team.name }}</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="mt-auto">
|
||||
<a href="#" class="group -mx-2 flex gap-x-3 rounded-md p-2 text-sm/6 font-semibold text-gray-700 hover:bg-gray-50 hover:text-indigo-600 dark:text-gray-300 dark:hover:bg-white/5 dark:hover:text-white">
|
||||
<Cog6ToothIcon class="size-6 shrink-0 text-gray-400 group-hover:text-indigo-600 dark:group-hover:text-white" aria-hidden="true" />
|
||||
Settings
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</DialogPanel>
|
||||
</TransitionChild>
|
||||
</div>
|
||||
</Dialog>
|
||||
</TransitionRoot>
|
||||
|
||||
<!-- Static sidebar for desktop -->
|
||||
<div class="hidden bg-gray-900 lg:fixed lg:inset-y-0 lg:z-50 lg:flex lg:w-72 lg:flex-col">
|
||||
<!-- Sidebar component, swap this element with another sidebar if you like -->
|
||||
<div class="flex grow flex-col gap-y-5 overflow-y-auto border-r border-gray-200 bg-white px-6 pb-4 dark:border-white/10 dark:bg-black/10">
|
||||
<div class="flex h-16 shrink-0 items-center">
|
||||
<img class="h-8 w-auto dark:hidden" src="https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=600" alt="Your Company" />
|
||||
<img class="hidden h-8 w-auto dark:block" src="https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=500" alt="Your Company" />
|
||||
</div>
|
||||
<nav class="flex flex-1 flex-col">
|
||||
<ul role="list" class="flex flex-1 flex-col gap-y-7">
|
||||
<li>
|
||||
<ul role="list" class="-mx-2 space-y-1">
|
||||
<li v-for="item in navigation" :key="item.name">
|
||||
<a :href="item.href" :class="[item.current ? 'bg-gray-50 text-indigo-600 dark:bg-white/5 dark:text-white' : 'text-gray-700 hover:bg-gray-50 hover:text-indigo-600 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-white', 'group flex gap-x-3 rounded-md p-2 text-sm/6 font-semibold']">
|
||||
<component :is="item.icon" :class="[item.current ? 'text-indigo-600 dark:text-white' : 'text-gray-400 group-hover:text-indigo-600 dark:group-hover:text-white', 'size-6 shrink-0']" aria-hidden="true" />
|
||||
{{ item.name }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<div class="text-xs/6 font-semibold text-gray-400">Your teams</div>
|
||||
<ul role="list" class="-mx-2 mt-2 space-y-1">
|
||||
<li v-for="team in teams" :key="team.name">
|
||||
<a :href="team.href" :class="[team.current ? 'bg-gray-50 text-indigo-600 dark:bg-white/5 dark:text-white' : 'text-gray-700 hover:bg-gray-50 hover:text-indigo-600 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-white', 'group flex gap-x-3 rounded-md p-2 text-sm/6 font-semibold']">
|
||||
<span :class="[team.current ? 'border-indigo-600 text-indigo-600 dark:border-white/20 dark:text-white' : 'border-gray-200 text-gray-400 group-hover:border-indigo-600 group-hover:text-indigo-600 dark:border-white/10 dark:group-hover:border-white/20 dark:group-hover:text-white', 'flex size-6 shrink-0 items-center justify-center rounded-lg border bg-white text-[0.625rem] font-medium dark:bg-white/5']">{{ team.initial }}</span>
|
||||
<span class="truncate">{{ team.name }}</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="mt-auto">
|
||||
<a href="#" class="group -mx-2 flex gap-x-3 rounded-md p-2 text-sm/6 font-semibold text-gray-700 hover:bg-gray-50 hover:text-indigo-600 dark:text-gray-300 dark:hover:bg-white/5 dark:hover:text-white">
|
||||
<Cog6ToothIcon class="size-6 shrink-0 text-gray-400 group-hover:text-indigo-600 dark:group-hover:text-white" aria-hidden="true" />
|
||||
Settings
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="lg:pl-72">
|
||||
<div class="sticky top-0 z-40 flex h-16 shrink-0 items-center gap-x-4 border-b border-gray-200 bg-white px-4 shadow-sm sm:gap-x-6 sm:px-6 lg:px-8 dark:border-white/10 dark:bg-gray-900 dark:shadow-none">
|
||||
<button type="button" class="-m-2.5 p-2.5 text-gray-700 hover:text-gray-900 lg:hidden dark:text-gray-400 dark:hover:text-white" @click="sidebarOpen = true">
|
||||
<span class="sr-only">Open sidebar</span>
|
||||
<Bars3Icon class="size-6" aria-hidden="true" />
|
||||
</button>
|
||||
|
||||
<!-- Separator -->
|
||||
<div class="h-6 w-px bg-gray-200 lg:hidden dark:bg-white/10" aria-hidden="true"></div>
|
||||
|
||||
<div class="flex flex-1 gap-x-4 self-stretch lg:gap-x-6">
|
||||
<form class="grid flex-1 grid-cols-1" action="#" method="GET">
|
||||
<input name="search" aria-label="Search" class="col-start-1 row-start-1 block size-full bg-white pl-8 text-base text-gray-900 outline-none placeholder:text-gray-400 sm:text-sm/6 dark:bg-gray-900 dark:text-white dark:placeholder:text-gray-500" placeholder="Search" />
|
||||
<MagnifyingGlassIcon class="pointer-events-none col-start-1 row-start-1 size-5 self-center text-gray-400" aria-hidden="true" />
|
||||
</form>
|
||||
<div class="flex items-center gap-x-4 lg:gap-x-6">
|
||||
<button type="button" class="-m-2.5 p-2.5 text-gray-400 hover:text-gray-500 dark:hover:text-white">
|
||||
<span class="sr-only">View notifications</span>
|
||||
<BellIcon class="size-6" aria-hidden="true" />
|
||||
</button>
|
||||
|
||||
<!-- Separator -->
|
||||
<div class="hidden lg:block lg:h-6 lg:w-px lg:bg-gray-200 dark:lg:bg-white/10" aria-hidden="true"></div>
|
||||
|
||||
<!-- Profile dropdown -->
|
||||
<Menu as="div" class="relative">
|
||||
<MenuButton class="relative flex items-center">
|
||||
<span class="absolute -inset-1.5"></span>
|
||||
<span class="sr-only">Open user menu</span>
|
||||
<img class="size-8 rounded-full bg-gray-50 outline outline-1 -outline-offset-1 outline-black/5 dark:bg-gray-800 dark:outline-white/10" src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" alt="" />
|
||||
<span class="hidden lg:flex lg:items-center">
|
||||
<span class="ml-4 text-sm/6 font-semibold text-gray-900 dark:text-white" aria-hidden="true">Tom Cook</span>
|
||||
<ChevronDownIcon class="ml-2 size-5 text-gray-400 dark:text-gray-500" aria-hidden="true" />
|
||||
</span>
|
||||
</MenuButton>
|
||||
<transition enter-active-class="transition ease-out duration-100" enter-from-class="transform opacity-0 scale-95" enter-to-class="transform scale-100" leave-active-class="transition ease-in duration-75" leave-from-class="transform scale-100" leave-to-class="transform opacity-0 scale-95">
|
||||
<MenuItems class="absolute right-0 z-10 mt-2.5 w-32 origin-top-right rounded-md bg-white py-2 shadow-lg outline outline-1 outline-gray-900/5 dark:bg-gray-800 dark:shadow-none dark:-outline-offset-1 dark:outline-white/10">
|
||||
<MenuItem v-for="item in userNavigation" :key="item.name" v-slot="{ active }">
|
||||
<a :href="item.href" :class="[active ? 'bg-gray-50 outline-none dark:bg-white/5' : '', 'block px-3 py-1 text-sm/6 text-gray-900 dark:text-white']">{{ item.name }}</a>
|
||||
</MenuItem>
|
||||
</MenuItems>
|
||||
</transition>
|
||||
</Menu>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<main class="py-10">
|
||||
<div class="px-4 sm:px-6 lg:px-8">
|
||||
<!-- Your content -->
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import {
|
||||
Dialog,
|
||||
DialogPanel,
|
||||
Menu,
|
||||
MenuButton,
|
||||
MenuItem,
|
||||
MenuItems,
|
||||
TransitionChild,
|
||||
TransitionRoot,
|
||||
} from '@headlessui/vue'
|
||||
import {
|
||||
Bars3Icon,
|
||||
BellIcon,
|
||||
CalendarIcon,
|
||||
ChartPieIcon,
|
||||
Cog6ToothIcon,
|
||||
DocumentDuplicateIcon,
|
||||
FolderIcon,
|
||||
HomeIcon,
|
||||
UsersIcon,
|
||||
XMarkIcon,
|
||||
} from '@heroicons/vue/24/outline'
|
||||
import { ChevronDownIcon, MagnifyingGlassIcon } from '@heroicons/vue/20/solid'
|
||||
|
||||
const navigation = [
|
||||
{ name: 'Dashboard', href: '#', icon: HomeIcon, current: true },
|
||||
{ name: 'Team', href: '#', icon: UsersIcon, current: false },
|
||||
{ name: 'Projects', href: '#', icon: FolderIcon, current: false },
|
||||
{ name: 'Calendar', href: '#', icon: CalendarIcon, current: false },
|
||||
{ name: 'Documents', href: '#', icon: DocumentDuplicateIcon, current: false },
|
||||
{ name: 'Reports', href: '#', icon: ChartPieIcon, current: false },
|
||||
]
|
||||
const teams = [
|
||||
{ id: 1, name: 'Heroicons', href: '#', initial: 'H', current: false },
|
||||
{ id: 2, name: 'Tailwind Labs', href: '#', initial: 'T', current: false },
|
||||
{ id: 3, name: 'Workcation', href: '#', initial: 'W', current: false },
|
||||
]
|
||||
const userNavigation = [
|
||||
{ name: 'Your profile', href: '#' },
|
||||
{ name: 'Sign out', href: '#' },
|
||||
]
|
||||
|
||||
const sidebarOpen = ref(false)
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue