| 1 |
import { CSSProperties, useState } from "react"; |
| 2 |
import { UpsellEnhancedModal } from "./UpsellModal"; |
| 3 |
import { createPortal } from "react-dom"; |
| 4 |
|
| 5 |
interface LockedTableTypeProps { |
| 6 |
icon: JSX.Element; |
| 7 |
selected?: string; |
| 8 |
style?: CSSProperties; |
| 9 |
name: string; |
| 10 |
link?: string; |
| 11 |
} |
| 12 |
|
| 13 |
export default function LockedTableType({ |
| 14 |
icon, |
| 15 |
selected, |
| 16 |
style, |
| 17 |
name, |
| 18 |
link = "https://tableberg.com/pricing/", |
| 19 |
}: LockedTableTypeProps) { |
| 20 |
const [showUpsell, setVisibility] = useState(false); |
| 21 |
|
| 22 |
return ( |
| 23 |
<> |
| 24 |
<button |
| 25 |
className="tableberg-table-creator-btn tableberg-upsell" |
| 26 |
style={style} |
| 27 |
onClick={() => setVisibility(true)} |
| 28 |
> |
| 29 |
<div className="tableberg-table-creator-btn-icon">{icon}</div> |
| 30 |
<span>{name}</span> |
| 31 |
</button> |
| 32 |
{showUpsell && |
| 33 |
createPortal( |
| 34 |
<UpsellEnhancedModal |
| 35 |
onClose={() => setVisibility(false)} |
| 36 |
selected={selected} |
| 37 |
link={link} |
| 38 |
/>, |
| 39 |
document.body |
| 40 |
)} |
| 41 |
</> |
| 42 |
); |
| 43 |
} |
| 44 |
|