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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
| import { Droppable } from '@hello-pangea/dnd';
| import { Box, Stack, Typography } from '@mui/material';
|
| import { Deal } from '../types';
| import { DealCard } from './MissionCard';
| import { useConfigurationContext } from '../root/ConfigurationContext';
| import { findDealLabel } from './deal';
|
| export const MissionColumn = ({ stage, deals, }) => {
| const totalAmount = deals.reduce((sum, deal) => sum + deal.amount, 0);
|
| const { dealStages } = useConfigurationContext();
| return (
| <Box
| sx={{
| flex: 1,
| paddingTop: '8px',
| paddingBottom: '16px',
| bgcolor: '#eaeaee',
| '&:first-of-type': {
| paddingLeft: '5px',
| borderTopLeftRadius: 5,
| },
| '&:last-of-type': {
| paddingRight: '5px',
| borderTopRightRadius: 5,
| },
| }}
| >
| <Stack alignItems="center">
| <Typography variant="subtitle1">
| {findDealLabel(dealStages, stage)}
| </Typography>
| <Typography
| variant="subtitle1"
| color="text.secondary"
| fontSize="small"
| >
| {totalAmount.toLocaleString('en-US', {
| notation: 'compact',
| style: 'currency',
| currency: 'USD',
| currencyDisplay: 'narrowSymbol',
| minimumSignificantDigits: 3,
| })}
| </Typography>
| </Stack>
| <Droppable droppableId={stage}>
| {(droppableProvided, snapshot) => (
| <Box
| ref={droppableProvided.innerRef}
| {...droppableProvided.droppableProps}
| className={
| snapshot.isDraggingOver ? ' isDraggingOver' : ''
| }
| sx={{
| display: 'flex',
| flexDirection: 'column',
| borderRadius: 1,
| padding: '5px',
| '&.isDraggingOver': {
| bgcolor: '#dadadf',
| },
| }}
| >
| {deals.map((deal, index) => (
| <DealCard key={deal.id} deal={deal} index={index} />
| ))}
| {droppableProvided.placeholder}
| </Box>
| )}
| </Droppable>
| </Box>
| );
| };
|
|