| 1 |
import { loaderThreeDots } from '@auto-launch/icons'; |
| 2 |
import { activeModalTemplate } from '@auto-launch/templates'; |
| 3 |
|
| 4 |
// The template's box draws the card, or an overlay's surface settings reach |
| 5 |
// nothing on the screens whose content brought its own. |
| 6 |
export const WaitBox = ({ icon, message, note }) => ( |
| 7 |
<div className="flex flex-col items-center gap-3"> |
| 8 |
<div className="h-8 w-8 fill-current text-ui-ink"> |
| 9 |
{icon ?? loaderThreeDots} |
| 10 |
</div> |
| 11 |
<p className="m-0 text-center text-ui-body leading-ui text-ui-ink"> |
| 12 |
{message} |
| 13 |
</p> |
| 14 |
{note ? ( |
| 15 |
<p className="m-0 max-w-md text-center text-ui-body leading-ui text-ui-ink opacity-70"> |
| 16 |
{note} |
| 17 |
</p> |
| 18 |
) : null} |
| 19 |
</div> |
| 20 |
); |
| 21 |
|
| 22 |
export const WaitingOverlay = ({ show, icon, message, note }) => { |
| 23 |
if (!show) return null; |
| 24 |
const Page = activeModalTemplate(); |
| 25 |
return ( |
| 26 |
<Page |
| 27 |
parts={{ body: <WaitBox icon={icon} message={message} note={note} /> }} |
| 28 |
has={{ card: true }} |
| 29 |
/> |
| 30 |
); |
| 31 |
}; |
| 32 |
|