File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ export const cropIcons = {
2+ potato : "/crop_icons/potato.svg" ,
3+ soybean : "/crop_icons/soy_bean.svg" ,
4+ "sugar beet" : "/crop_icons/sugar_beet.svg" ,
5+ tomato : "/crop_icons/tomato.svg" ,
6+ wheat : "/crop_icons/wheat.svg" ,
7+ } ;
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import StatusPill from "../components/StatusPill.jsx";
77import MetricsChart from "../components/MetricsChart.jsx" ;
88import FieldDrawMap from "../components/FieldDrawMap.jsx" ;
99import fieldSvg from "../assets/field.svg" ;
10+ import { cropIcons } from "../constants/cropIcons.js" ;
1011
1112export default function FieldDetails ( ) {
1213 const { id } = useParams ( ) ;
@@ -29,6 +30,8 @@ export default function FieldDetails() {
2930
3031 const token = localStorage . getItem ( "token" ) ;
3132
33+ const crop = field ?. meta ?. crop ;
34+
3235 const load = async ( ) => {
3336 setLoading ( true ) ;
3437 try {
@@ -173,7 +176,10 @@ export default function FieldDetails() {
173176 < StatusPill status = { field . status } />
174177 </ div >
175178 < div className = "mt-1 text-sm text-gray-600 flex items-center gap-3" >
176- < img src = "/favicon.svg" className = "h-16 w-16" />
179+ < img
180+ src = { cropIcons [ crop . toLowerCase ( ) ] || "/favicon.svg" }
181+ className = "h-10 w-10"
182+ />
177183 < span > { field ?. meta ?. crop || "—" } </ span >
178184 < span className = "text-gray-300" > •</ span >
179185 < span title = "Area" > { field ?. meta ?. areaHa ?? "—" } ha</ span >
You can’t perform that action at this time.
0 commit comments