Last change
on this file was bc20307, checked in by Tasevski2 <39170279+Tasevski2@…>, 2 years ago |
Push before video
|
-
Property mode
set to
100644
|
File size:
1.5 KB
|
Rev | Line | |
---|
[3a58bd6] | 1 | import { useHistory } from 'react-router-dom';
|
---|
| 2 |
|
---|
| 3 | import {
|
---|
[bc20307] | 4 | ParkingZoneWrapper,
|
---|
| 5 | Container,
|
---|
| 6 | ZoneName,
|
---|
| 7 | InfoWrapper,
|
---|
| 8 | Label,
|
---|
| 9 | Value,
|
---|
| 10 | ProgressBar,
|
---|
| 11 | ProgressBarLabel,
|
---|
[3a58bd6] | 12 | } from './styles';
|
---|
| 13 |
|
---|
[bc20307] | 14 | import DropdownViewer from '../../../DropdownViewer';
|
---|
| 15 |
|
---|
[3a58bd6] | 16 | const ParkingZoneCard = ({ info }) => {
|
---|
[bc20307] | 17 | let history = useHistory();
|
---|
| 18 | const takenDividedByTotal = info.takenSpaces / info.capacity;
|
---|
[3a58bd6] | 19 |
|
---|
[bc20307] | 20 | return (
|
---|
| 21 | <ParkingZoneWrapper item xs={11} sm={6} md={3}>
|
---|
| 22 | <Container onClick={() => history.push(`/zone/${info.id}`)}>
|
---|
| 23 | <ZoneName>{info.pzName}</ZoneName>
|
---|
| 24 | <InfoWrapper>
|
---|
| 25 | <Label>Одговорни лица:</Label>
|
---|
| 26 | <DropdownViewer data={info?.responsibleWorkers ?? [] } />
|
---|
| 27 | </InfoWrapper>
|
---|
| 28 | <InfoWrapper style={{ marginTop: '30px' }}>
|
---|
| 29 | <Label>Број на паркинг места:</Label>
|
---|
| 30 | <Value>{info.capacity}</Value>
|
---|
| 31 | </InfoWrapper>
|
---|
| 32 | <ProgressBar
|
---|
| 33 | percent={Math.floor(
|
---|
| 34 | (isNaN(takenDividedByTotal) ? 0 : takenDividedByTotal) *
|
---|
| 35 | 100
|
---|
| 36 | )}
|
---|
| 37 | label={() => (
|
---|
| 38 | <ProgressBarLabel>
|
---|
| 39 | {info.takenSpaces}/{info.capacity}
|
---|
| 40 | </ProgressBarLabel>
|
---|
| 41 | )}
|
---|
| 42 | />
|
---|
| 43 | </Container>
|
---|
| 44 | </ParkingZoneWrapper>
|
---|
| 45 | );
|
---|
[3a58bd6] | 46 | };
|
---|
| 47 |
|
---|
| 48 | export default ParkingZoneCard;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.