cleanup around manual prices
This commit is contained in:
@@ -263,7 +263,7 @@ const props = defineProps<{
|
||||
result: ProfitResult
|
||||
}>()
|
||||
|
||||
const { isManualPrice, getManualEntry, setManualPrice, clearManualPrice } = useAlbionPrices()
|
||||
const { getManualEntry, setManualPrice, clearManualPrice } = useAlbionPrices()
|
||||
const { filters } = useFilters()
|
||||
const { upsert, remove, getQty, inOrder } = useProductionOrder()
|
||||
|
||||
@@ -345,23 +345,16 @@ function ageDotTitle(result: ProfitResult): string {
|
||||
|
||||
// ─── Price cell helpers ───────────────────────────────────────────────────────
|
||||
|
||||
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'
|
||||
}
|
||||
|
||||
// ─── Edit state ───────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user