manifold/web/components/tweet-button.tsx
2022-01-05 23:02:39 -06:00

25 lines
581 B
TypeScript

import clsx from 'clsx'
export function TweetButton(props: { className?: string; tweetText?: string }) {
const { tweetText, className } = props
return (
<a
className={clsx('btn btn-xs normal-case border-none', className)}
style={{ backgroundColor: '#1da1f2', width: 75 }}
href={`https://twitter.com/intent/tweet?text=${encodeURIComponent(
tweetText ?? ''
)}`}
target="_blank"
>
<img
className="mr-2"
src={'/twitter-icon-white.svg'}
width={15}
height={15}
/>
Tweet
</a>
)
}