import type {BlacklistItem} from "~/classes/blacklistItem";
import {Dialog, DialogContent, DialogTitle, Divider} from "@mui/material";
import NicknameList from "~/components/itemDialog/nicknameList";
import CommentsList from "~/components/itemDialog/commentsList";
import TagList from "~/components/itemDialog/tagList";
import TitleHeader from "~/components/itemDialog/titleHeader";

export default function ItemDialog({ blacklistItem, open, handleClose }: { blacklistItem: BlacklistItem|null, open: boolean, handleClose: Function }){
    return (
        <Dialog
            open={open}
            onClose={() => handleClose()}
        >
            <DialogTitle>
                <TitleHeader name={blacklistItem?.link} handleClose={handleClose}/>
                <TagList
                    afk={blacklistItem?.afk}
                    cheater={blacklistItem?.cheater}
                    griefer={blacklistItem?.griefer}
                    toxic={blacklistItem?.toxic}
                    useless={blacklistItem?.useless}
                    smurf={blacklistItem?.smurf}
                />
            </DialogTitle>
            <Divider sx={{marginTop: '10px', marginBottom: '10px', alignSelf: 'center'}}/>
            <DialogContent>
                <NicknameList nicknames={blacklistItem?.nicknames}/>
                <CommentsList comments={blacklistItem?.comments}/>
            </DialogContent>
        </Dialog>
    )
}