import React, { useState } from 'react';
import { makeStyles, Popover } from '@material-ui/core';
import { ArrowUpRightIcon, PDFIcon, ExcelDocumentIcon, TextDocumentIcon } from '@fluentui/react-icons';
import { AmbientPopoverMenuItem } from '../../../inputs/buttons/AmbientPopoverMenuItem';
import { FluentIconButton } from '../../../inputs/buttons/FluentIconButton';
const useStyles = makeStyles((theme) => ({
    root: {},
    popoverRoot: {},
    icon: {
        color: theme.palette.secondary.main
    }
}));
export const PAHExport = ({ exportCSV, exportExcel, exportPDF }) => {
    const classes = useStyles();
    const [anchorEl, setAnchorEl] = useState(null);
    const handleClick = (event) => {
        setAnchorEl(event.currentTarget);
    };
    const handleClose = () => {
        setAnchorEl(null);
    };
    const open = Boolean(anchorEl);
    const id = open ? 'simple-popover' : undefined;
    const gridControlsExport = [
        {
            label: 'Export CSV',
            component: TextDocumentIcon,
            click: exportCSV,
            key: 1
        },
        {
            label: 'Export Excel',
            component: ExcelDocumentIcon,
            click: exportExcel,
            key: 2
        }
    ];
    // if (exportPDF) {
    //   gridControlsExport.push({
    //     label: 'Export PDF',
    //     component: PDFIcon,
    //     click: exportPDF,
    //     key: 3
    //   });
    // }
    return (React.createElement("div", { className: classes.root }, React.createElement(FluentIconButton, { className: classes.icon, icon: ArrowUpRightIcon, onClick: handleClick }), React.createElement(Popover, { classes: { root: classes.popoverRoot }, square: true, elevation: 1, id: id, open: open, anchorEl: anchorEl, onClose: handleClose, anchorOrigin: {
            vertical: 'bottom',
            horizontal: 'left'
        }, transformOrigin: {
            vertical: 'top',
            horizontal: 'left'
        } }, React.createElement("div", { style: { width: 140 } }, React.createElement("div", null, gridControlsExport.map((item) => {
        return (React.createElement(AmbientPopoverMenuItem, { label: item.label, component: item.component, click: item.click }));
    }))))));
};
//# sourceMappingURL=PAHExport.js.map