import { Trans } from "@lingui/macro" import { ActionIcon, Tooltip } from "@mantine/core" import { Constants } from "app/constants" import { starEntry } from "app/entries/thunks" import { useAppDispatch } from "app/store" import type { Entry } from "app/types" import { TbStar, TbStarFilled } from "react-icons/tb" export function Star(props: { entry: Entry }) { const dispatch = useAppDispatch() const onClick = (e: React.MouseEvent) => { e.stopPropagation() e.preventDefault() dispatch( starEntry({ entry: props.entry, starred: !props.entry.starred, }) ) } return ( Unstar : Star} openDelay={Constants.tooltip.delay}> {props.entry.starred ? : } ) }