-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made changes to broadcasts per ATM feedback.
- Loading branch information
1 parent
2bc2896
commit f11b9b8
Showing
8 changed files
with
80 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
'use client'; | ||
import React, {useState} from 'react'; | ||
import {ChangeBroadcast, User} from "@prisma/client"; | ||
import {Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Tooltip} from "@mui/material"; | ||
import {GridActionsCellItem} from "@mui/x-data-grid"; | ||
import {Check} from "@mui/icons-material"; | ||
import {getRating} from "@/lib/vatsim"; | ||
import Link from "next/link"; | ||
|
||
export default function BroadcastAgreedViewerButton({broadcast, agreedBy}: { | ||
broadcast: ChangeBroadcast, | ||
agreedBy: User[], | ||
}) { | ||
|
||
const [open, setOpen] = useState(false); | ||
|
||
return ( | ||
<> | ||
<Tooltip title="View Controllers Reviewed"> | ||
<GridActionsCellItem | ||
icon={<Check/>} | ||
label="View Controllers Reviewed" | ||
onClick={() => setOpen(true)} | ||
/> | ||
</Tooltip> | ||
<Dialog open={open} onClose={() => setOpen(false)}> | ||
<DialogTitle>Agreed - {broadcast.title}</DialogTitle> | ||
<DialogContent> | ||
<DialogContentText>Click on a controller to view profile in a new tab.</DialogContentText> | ||
<DialogContentText gutterBottom>The following controllers have reviewed this | ||
broadcast:</DialogContentText> | ||
<ul> | ||
{agreedBy | ||
.sort((a, b) => (a.lastName || '').localeCompare(b.lastName || '')) | ||
.map((user) => ( | ||
<li key={user.id}> | ||
<Link href={`/admin/controller/${user.cid}`} style={{textDecoration: 'none',}} | ||
target="_blank"> | ||
<DialogContentText>{user.firstName} {user.lastName} - {getRating(user.rating)}</DialogContentText> | ||
</Link> | ||
</li> | ||
))} | ||
</ul> | ||
</DialogContent> | ||
<DialogActions> | ||
<Button onClick={() => setOpen(false)} color="inherit">Close</Button> | ||
</DialogActions> | ||
</Dialog> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters