40 lines
1.0 KiB
TypeScript
40 lines
1.0 KiB
TypeScript
import { ReactNode } from 'react'
|
|
import {
|
|
Dropdown,
|
|
DropdownOption,
|
|
DropdownSeparator,
|
|
} from '../elements/DropdownElements'
|
|
|
|
type DropdownMenuProps = {
|
|
triggerElement: ReactNode
|
|
articleActionHandler: (action: string, arg?: unknown) => void
|
|
}
|
|
|
|
export function ReaderDropdownMenu(props: DropdownMenuProps): JSX.Element {
|
|
return (
|
|
<Dropdown triggerElement={props.triggerElement}>
|
|
<DropdownOption
|
|
onSelect={() => props.articleActionHandler('archive')}
|
|
title="Archive (e)"
|
|
/>
|
|
<DropdownOption
|
|
onSelect={() => props.articleActionHandler('setLabels')}
|
|
title="Edit Labels (l)"
|
|
/>
|
|
<DropdownOption
|
|
onSelect={() => props.articleActionHandler('showEditModal')}
|
|
title="Edit Info (i)"
|
|
/>
|
|
<DropdownOption
|
|
onSelect={() => props.articleActionHandler('delete')}
|
|
title="Remove (#)"
|
|
/>
|
|
<DropdownSeparator />
|
|
<DropdownOption
|
|
onSelect={() => window.Intercom('show')}
|
|
title="Feedback"
|
|
/>
|
|
</Dropdown>
|
|
)
|
|
}
|