(props: Props)
| 7 | } |
| 8 | |
| 9 | const ProductHuntBanner = (props: Props) => { |
| 10 | const { className } = props; |
| 11 | const { t } = useTranslation(); |
| 12 | const [hideBanner, setHideBanner] = useLocalStorage("hide-product-hunt-banner", false); |
| 13 | const show = !hideBanner; |
| 14 | |
| 15 | return ( |
| 16 | <div |
| 17 | className={`${!show && "!hidden"} ${ |
| 18 | className || "" |
| 19 | } relative w-full flex bg-[#f26150] text-white flex-row justify-start sm:justify-center items-center px-4 py-1 dark:opacity-70`} |
| 20 | > |
| 21 | <a |
| 22 | className="text-sm leading-6 pr-4 cursor-pointer hover:underline" |
| 23 | href="https://www.producthunt.com/posts/sql-chat-2" |
| 24 | target="_blank" |
| 25 | > |
| 26 | {t("banner.product-hunt")} |
| 27 | </a> |
| 28 | <button className="absolute right-2 sm:right-4 opacity-60 hover:opacity-100" onClick={() => setHideBanner(true)}> |
| 29 | <Icon.BiX className="w-6 h-auto" /> |
| 30 | </button> |
| 31 | </div> |
| 32 | ); |
| 33 | }; |
| 34 | |
| 35 | export default ProductHuntBanner; |
nothing calls this directly
no outgoing calls
no test coverage detected