cleanup around manual prices

This commit is contained in:
2026-03-05 02:54:36 -05:00
parent d8386dccf4
commit c069060d8b
4 changed files with 21 additions and 36 deletions

View File

@@ -238,7 +238,7 @@ import type { Tier, JournalType } from '../types/crafting'
const vFocus = { mounted: (el: HTMLElement) => el.focus() }
const { orderItems, upsert, remove, clear } = useProductionOrder()
const { getPrice, isManualPrice, getManualEntry, setManualPrice, clearManualPrice } = useAlbionPrices()
const { getPrice, getManualEntry, setManualPrice, clearManualPrice } = useAlbionPrices()
const { filters } = useFilters()
// ─── Inline price editing ─────────────────────────────────────────────────────
@@ -267,21 +267,16 @@ function cancelEdit() {
inputValue.value = ''
}
function priceButtonClass(itemId: string, currentPrice: number): string {
if (isManualPrice(itemId, filters.value.city)) return 'text-amber-400 hover:text-amber-200'
if (currentPrice === 0) return 'text-gray-500 hover:text-amber-400'
return 'text-gray-300 hover:text-gray-100'
function priceButtonClass(_itemId: string, currentPrice: number): string {
return currentPrice > 0 ? 'text-amber-400 hover:text-amber-200' : 'text-gray-500 hover:text-amber-400'
}
function priceTitle(itemId: string, currentPrice: number): string {
const exact = currentPrice > 0 ? currentPrice.toLocaleString() : null
const entry = getManualEntry(itemId, filters.value.city)
if (entry && isManualPrice(itemId, filters.value.city)) {
return exact
? `${exact} — set ${formatLastUpdated(new Date(entry.editedAt))} — click to edit`
: `Set ${formatLastUpdated(new Date(entry.editedAt))} — click to edit`
if (entry) {
return `${currentPrice.toLocaleString()} — set ${formatLastUpdated(new Date(entry.editedAt))} — click to edit`
}
return exact ? `${exact} — click to set price` : 'Click to set price'
return 'Click to set price'
}
// ─── Order sort ───────────────────────────────────────────────────────────────