diff --git a/web/src/components/plants/DeleteSeedLotModal.tsx b/web/src/components/plants/DeleteSeedLotModal.tsx index f87c25b..5d7dc00 100644 --- a/web/src/components/plants/DeleteSeedLotModal.tsx +++ b/web/src/components/plants/DeleteSeedLotModal.tsx @@ -3,8 +3,7 @@ import { Alert } from '@/components/ui/Alert' import { Button } from '@/components/ui/Button' import { Modal } from '@/components/ui/Modal' import { errorMessage } from '@/lib/api' -import { useDeleteSeedLot, type SeedLot } from '@/lib/seedLots' -import { formatQuantity } from './SeedLotList' +import { formatQuantity, useDeleteSeedLot, type SeedLot } from '@/lib/seedLots' /** * Retire a lot. Worth confirming because it's the one place cost and germination diff --git a/web/src/components/plants/PlantCard.tsx b/web/src/components/plants/PlantCard.tsx index 6906f67..2a8d771 100644 --- a/web/src/components/plants/PlantCard.tsx +++ b/web/src/components/plants/PlantCard.tsx @@ -1,9 +1,10 @@ import { useState } from 'react' import { PlantIcon } from './PlantIcon' -import { LotStateChip, SeedLotList, formatQuantity } from './SeedLotList' +import { LotStateChip, SeedLotList } from './SeedLotList' +import { SourceLink } from './SourceLink' import { cardActionClass, cardDangerClass } from '@/components/ui/cardActions' import { CATEGORY_LABELS, isBuiltin, type Plant } from '@/lib/plants' -import { safeExternalUrl, summarizeLots, type SeedLot } from '@/lib/seedLots' +import { formatQuantity, summarizeLots, type SeedLot } from '@/lib/seedLots' import { formatSpacing, type UnitPref } from '@/lib/units' /** @@ -37,7 +38,7 @@ export function PlantCard({ const builtin = isBuiltin(plant) const [showLots, setShowLots] = useState(false) const summary = summarizeLots(lots) - const sourceUrl = safeExternalUrl(plant.sourceUrl) + return (
{CATEGORY_LABELS[plant.category]} · {formatSpacing(plant.spacingCm, unit)} spacing
- {(plant.vendor || sourceUrl) && ( + {(plant.vendor || plant.sourceUrl) && (
{plant.vendor && {plant.vendor}}
- {sourceUrl && (
-
- source ↗
-
- )}
+
{plant.notes}
} diff --git a/web/src/components/plants/SeedLotList.tsx b/web/src/components/plants/SeedLotList.tsx index 9f8dd8a..afff2c0 100644 --- a/web/src/components/plants/SeedLotList.tsx +++ b/web/src/components/plants/SeedLotList.tsx @@ -1,10 +1,11 @@ import { Button } from '@/components/ui/Button' import { cn } from '@/lib/cn' +import { SourceLink } from './SourceLink' import { formatCost, + formatQuantity, formatUnitCost, lotState, - safeExternalUrl, type LotState, type SeedLot, } from '@/lib/seedLots' @@ -20,7 +21,9 @@ const STATE_LABEL: Record