import { useShowModal } from './modal' import { useToast } from './toast' import ItemAct from './item-act' import AccordianItem from './accordian-item' import { useMemo } from 'react' import getColor from '@/lib/rainbow' import BoostIcon from '@/svgs/arrow-up-double-line.svg' import styles from './upvote.module.css' import { BoostHelp } from './adv-post-form' import { BOOST_MULT } from '@/lib/constants' import classNames from 'classnames' export default function Boost ({ item, className, ...props }) { const { boost } = item const [color, nextColor] = useMemo(() => [getColor(boost), getColor(boost + BOOST_MULT)], [boost]) const style = useMemo(() => ({ '--hover-fill': nextColor, '--hover-filter': `drop-shadow(0 0 6px ${nextColor}90)`, '--fill': color, '--filter': `drop-shadow(0 0 6px ${color}90)` }), [color, nextColor]) return (
} /> ) } function Booster ({ item, As, children }) { const toaster = useToast() const showModal = useShowModal() return ( { try { showModal(onClose => } /> ) } catch (error) { toaster.danger('failed to boost item') } }} > {children} ) }