mirror of
https://github.com/whscullin/apple2js.git
synced 2024-01-12 14:14:38 +00:00
The major impetus for rewriting in UI, at least. Still some ironing to do, but much nicer than my attempt to do this using the old UI "framework".
30 lines
840 B
TypeScript
30 lines
840 B
TypeScript
import { h } from 'preact';
|
|
import { Modal, ModalContent } from './Modal';
|
|
|
|
import styles from './css/ProgressModal.module.css';
|
|
|
|
export interface ErrorProps {
|
|
title: string;
|
|
current: number | undefined;
|
|
total: number | undefined;
|
|
}
|
|
|
|
export const ProgressModal = ({ title, current, total } : ErrorProps) => {
|
|
if (current && total) {
|
|
return (
|
|
<Modal title={title} isOpen={true}>
|
|
<ModalContent>
|
|
<div className={styles.progressContainer}>
|
|
<div
|
|
className={styles.progressBar}
|
|
style={{ width: Math.floor(320 * (current / total)) }}
|
|
/>
|
|
</div>
|
|
</ModalContent>
|
|
</Modal>
|
|
);
|
|
} else {
|
|
return null;
|
|
}
|
|
};
|