import React from 'react'
import { DownOutlined } from '@ant-design/icons'
import { Dropdown, Space } from 'antd'
import type { MenuProps } from 'antd'

interface DropdownMenuProps {
    items: MenuProps['items']
    buttonName: string
}

const DropdownMenu: React.FC<DropdownMenuProps> = ({ items, buttonName }) => (
    <Dropdown menu={{ items }} trigger={['click']}>
        <a
            onClick={(e) => {
                e.preventDefault()
            }}
        >
            <Space>
                {buttonName}
                <DownOutlined />
            </Space>
        </a>
    </Dropdown>
)

export default DropdownMenu
