Passed
Push — development ( 8e8ffd...1af938 )
by Peter
18:46 queued 06:25
created

ZoneTables.tsx ➔ ZoneTables   A

Complexity

Conditions 3

Size

Total Lines 19
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 3

Importance

Changes 0
Metric Value
cc 3
eloc 18
dl 0
loc 19
ccs 2
cts 2
cp 1
crap 3
rs 9.5
c 0
b 0
f 0
1
import { Zone } from "../helpers/map/leaflet-types"
2
import ZoneTable from "./ZoneTable"
3
import { Badge } from "flowbite-react"
4
5
type Props = {
6
    zoneData? : Zone[];
7
}
8
9
10
export default function ZoneTables( {zoneData} : Props ) {
11 3
  return (
12
        <div data-testid="zonetables">
13
            {zoneData?.map((zone: Zone) => (
14 1
                <div key={zone.id}>
15
                    
16
                <div className="flex flex-wrap items-center gap-4 p-4 mb-4 bg-gray-50 rounded-lg shadow">
17
                    <Badge color="info"><span className="font-bold text-xl">Name: {zone.name}</span></Badge>
18
                    <Badge color="success"><span className="font-bold text-xl">id: {zone.id}</span></Badge>
19
                    <Badge color="info"><span className="font-bold text-xl">Type: {zone.type}</span></Badge>
20
                    <Badge color="warning"><span className="font-bold text-xl">Number of bikes: {zone.bikes?.length}</span></Badge>
21
22
                </div>
23
                <ZoneTable zone={zone}/>
24
            </div>))
25
            }
26
        </div>
27
  )
28
}
29