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

frontend/src/components/ZoneTables.tsx   A

Complexity

Total Complexity 3
Complexity/F 3

Size

Lines of Code 29
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 24
dl 0
loc 29
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
wmc 3
mnd 2
bc 2
fnc 1
bpm 2
cpm 3
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A ZoneTables.tsx ➔ ZoneTables 0 19 3
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