Permalink
Newer
100644
127 lines (118 sloc)
3.57 KB
1
import {
2
Box,
3
Button,
4
Card,
5
CardBody,
6
CardFooter,
7
CardHeader,
8
Heading,
39
});
40
41
return;
42
}
43
44
toast({
45
description: `Inactivity notice ${accepted ? "accepted" : "denied"}.`,
46
isClosable: true,
47
status: "success",
57
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z" />
63
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z" />
67
return (
68
<Card w="100%">
69
<CardHeader>
70
<Heading size="md">Inactivity Notice for {props.user.username}</Heading>
71
<Text fontSize="xs">ID: {props.user.id}</Text>
72
</CardHeader>
73
<CardBody>
74
<Stack divider={<StackDivider />}>
75
<Box>
76
<Heading size="xs">Reason for Inactivity</Heading>
77
<Text>{props.reason}</Text>
78
</Box>
79
<Box>
80
<Heading size="xs">Start Date</Heading>
81
<Text>{new Date(props.start).toLocaleDateString()}</Text>
82
</Box>
83
<Box>
84
<Heading size="xs">End Date</Heading>
85
<Text>{new Date(props.end).toLocaleDateString()}</Text>
86
</Box>
87
{props.decisions ? (
88
<Box>
89
<Heading size="xs">Decisions</Heading>
90
<UnorderedList>
91
{Object.entries(props.decisions).map(([dept, accepted]) => (
92
<ListItem>
93
<Stack alignItems="center" direction="row">
94
<Text>{dept}: </Text>
95
{accepted ? <Approved /> : <Denied />}
106
<Button
107
colorScheme="red"
108
onClick={async () => await makeDecision(false)}
111
>
112
Deny
113
</Button>
114
<Button
115
colorScheme="blue"
116
ml="8px"
117
onClick={async () => await makeDecision(true)}