import { Button } from '../elements/Button'
import { HStack, Box } from '../elements/LayoutPrimitives'
import { AnchoredPopover } from '../patterns/AnchoredPopover'
import { StyledText } from '../elements/StyledText'
import { highlightBarKeyboardCommands } from '../../lib/keyboardShortcuts/navigationShortcuts'
import { useKeyboardShortcuts } from '../../lib/keyboardShortcuts/useKeyboardShortcuts'
import { styled, theme } from '../tokens/stitches.config'
import { PenIcon } from '../elements/images/PenIcon'
import { CommentIcon } from '../elements/images/CommentIcon'
import { ShareIcon } from '../elements/images/ShareIcon'
import { TrashIcon } from '../elements/images/TrashIcon'
import { isAndroid } from '../../lib/deviceType'
type PageCoordinates = {
pageX: number
pageY: number
}
export type HighlightAction =
| 'delete'
| 'create'
| 'comment'
| 'share'
| 'post'
| 'unshare'
type HighlightBarProps = {
anchorCoordinates: PageCoordinates
isNewHighlight: boolean
isSharedToFeed: boolean
isTouchscreenDevice: boolean
handleButtonClick: (action: HighlightAction) => void
}
export function HighlightBar(props: HighlightBarProps): JSX.Element {
if (props.isTouchscreenDevice) {
return (
)
} else {
return (
)
}
}
function BarContent(props: HighlightBarProps): JSX.Element {
useKeyboardShortcuts(
highlightBarKeyboardCommands((action) => {
switch (action) {
case 'createHighlight':
props.handleButtonClick('create')
break
case 'openNoteModal':
props.handleButtonClick('comment')
break
case 'openPostModal':
break
}
})
)
const Separator = styled('div', {
width: '1px',
maxWidth: '1px',
height: '100%',
background: '$grayBorder',
})
return (
{props.isNewHighlight ? (
) : (
)}
{/*
*/}
)
}