omnivore/packages/web/components/patterns/ReaderDropdownMenu.tsx

40 lines
1 KiB
TypeScript
Raw Normal View History

2023-03-06 08:21:20 +00:00
import { ReactNode } from 'react'
2023-03-03 13:55:04 +00:00
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)"
2023-03-03 13:55:04 +00:00
/>
<DropdownOption
2023-04-10 08:15:57 +00:00
onSelect={() => props.articleActionHandler('setLabels')}
2023-11-01 07:16:05 +00:00
title="Edit labels (l)"
2023-03-03 13:55:04 +00:00
/>
<DropdownOption
onSelect={() => props.articleActionHandler('showEditModal')}
2023-11-01 07:16:05 +00:00
title="Edit info (i)"
2023-03-03 13:55:04 +00:00
/>
<DropdownOption
onSelect={() => props.articleActionHandler('delete')}
title="Remove (#)"
2023-03-03 13:55:04 +00:00
/>
<DropdownSeparator />
<DropdownOption
onSelect={() => window.Intercom('show')}
title="Feedback"
/>
</Dropdown>
)
}