manifold/web/components/tweet-button.tsx
2022-03-18 17:05:31 -07:00

27 lines
663 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 flex flex-row flex-nowrap border-none normal-case',
className
)}
style={{
backgroundColor: 'white',
border: '2px solid #1da1f2',
color: '#1da1f2',
}}
href={`https://twitter.com/intent/tweet?text=${encodeURIComponent(
tweetText ?? ''
)}`}
target="_blank"
>
<img className="mr-2" src={'/twitter-logo.svg'} width={15} height={15} />
<div>Tweet</div>
</a>
)
}