Copy playlist to clipboard, native UI (not alert)
This commit is contained in:
parent
e485844d86
commit
65e4f1b0a6
9 changed files with 135 additions and 24 deletions
33
crates/librqbit/webui/src/components/modal/AlertModal.tsx
Normal file
33
crates/librqbit/webui/src/components/modal/AlertModal.tsx
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { ErrorWithLabel } from "../../rqbit-web";
|
||||
import { useErrorStore } from "../../stores/errorStore";
|
||||
import { Button } from "../buttons/Button";
|
||||
import { Modal } from "./Modal";
|
||||
import { ModalBody } from "./ModalBody";
|
||||
import { ModalFooter } from "./ModalFooter";
|
||||
|
||||
export const AlertModal: React.FC<{}> = () => {
|
||||
let alert = useErrorStore((store) => store.alert);
|
||||
let removeAlert = useErrorStore((store) => store.removeAlert);
|
||||
|
||||
if (alert) {
|
||||
return (
|
||||
<Modal isOpen={true} onClose={removeAlert} title={alert.text}>
|
||||
<ModalBody>
|
||||
{alert.details?.statusText && (
|
||||
<div className="pb-2 text-md">{alert.details?.statusText}</div>
|
||||
)}
|
||||
<div className="whitespace-pre-wrap text-sm">
|
||||
{alert.details?.text}
|
||||
</div>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button variant="cancel" onClick={removeAlert}>
|
||||
Close
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
</Modal>
|
||||
);
|
||||
} else {
|
||||
return <></>;
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue