import { t } from "@lingui/macro" import { Checkbox, Group, Popover } from "@mantine/core" import { markEntry, starEntry } from "app/slices/entries" import { useAppDispatch, useAppSelector } from "app/store" import { Entry } from "app/types" import { ActionButton } from "components/ActionButtton" import { TbExternalLink, TbShare, TbStar, TbStarOff } 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 dispatch = useAppDispatch() const showSharingButtons = sharingSettings && (Object.values(sharingSettings) as Array).some(v => v) const readStatusCheckboxClicked = () => dispatch(markEntry({ entry: props.entry, read: !props.entry.read })) return ( {props.entry.markable && ( )} : } label={props.entry.starred ? t`Unstar` : t`Star`} onClick={() => dispatch(starEntry({ entry: props.entry, starred: !props.entry.starred }))} /> {showSharingButtons && ( } label={t`Share`} /> )} } label={t`Open link`} /> ) }