"src/services/grdfConsent.service.ts" did not exist on "809498639ab2393f330bdf79592767fbee6b8988"
Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import React from 'react'
import { IPrice } from '../../models/price.model'
import editing from '../../assets/icons/editing.png'
interface PriceSectionProps {
getDate: (date: string) => string
setPriceToSave: React.Dispatch<React.SetStateAction<IPrice>>
priceToSave: IPrice
price: IPrice
prices: IPrice[]
index: number
isNextPrice?: boolean
}
const PriceRow: React.FC<PriceSectionProps> = ({
getDate,
setPriceToSave,
priceToSave,
price,
prices,
index,
isNextPrice,
}: PriceSectionProps) => {
const editableLimit: number = 3
return (
<>
<li
className={
priceToSave.startDate === price.startDate
? 'flex-bloc price-selected'
: 'flex-bloc'
}
>
<div className="prix">
{price.price === '' ? '----' : price.price} €
</div>
<p>
à partir de :{' '}
<span className="capital">{getDate(price.startDate)}</span>
</p>
{index < editableLimit - 1 && (
<img
src={editing}
onClick={() => setPriceToSave(isNextPrice ? price : prices[index])}
alt="edit-icon"
/>
)}
</li>
<hr></hr>
</>
)
}
export default PriceRow