import { t, Trans } from "@lingui/macro" import { Group, Indicator, MultiSelect, Popover } from "@mantine/core" import { Constants } from "app/constants" import { markEntriesUpToEntry, markEntry, starEntry, tagEntry } from "app/slices/entries" import { useAppDispatch, useAppSelector } from "app/store" import { Entry } from "app/types" import { ActionButton } from "components/ActionButton" import { useMobile } from "hooks/useMobile" import { TbArrowBarToDown, TbExternalLink, TbEyeCheck, TbEyeOff, TbShare, TbStar, TbStarOff, TbTag } from "react-icons/tb" import { ShareButtons } from "./ShareButtons" interface FeedEntryFooterProps { entry: Entry } export function FeedEntryFooter(props: FeedEntryFooterProps) { const sharingSettings = useAppSelector(state => state.user.settings?.sharingSettings) const tags = useAppSelector(state => state.user.tags) const mobile = useMobile() const dispatch = useAppDispatch() const showSharingButtons = sharingSettings && Object.values(sharingSettings).some(v => v) const readStatusButtonClicked = () => dispatch(markEntry({ entry: props.entry, read: !props.entry.read })) const onTagsChange = (values: string[]) => dispatch( tagEntry({ entryId: +props.entry.id, tags: values, }) ) return ( {props.entry.markable && ( : } label={props.entry.read ? Keep unread : Mark as read} onClick={readStatusButtonClicked} /> )} : } label={props.entry.starred ? Unstar : Star} onClick={() => dispatch(starEntry({ entry: props.entry, starred: !props.entry.starred }))} /> {showSharingButtons && ( } label={Share} /> )} {tags && ( } label={Tags} /> t`Create tag: ${query}`} value={props.entry.tags} onChange={onTagsChange} /> )} } label={Open link} /> } label={Mark as read up to here} onClick={() => dispatch(markEntriesUpToEntry(props.entry))} /> ) }