mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-04-29 04:00:09 +00:00
enhance: isolate install logic from layout component
This commit is contained in:
parent
d8c502df21
commit
4de6eb1336
2 changed files with 90 additions and 29 deletions
|
|
@ -0,0 +1,50 @@
|
|||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from "@/components/ui/dialog";
|
||||
import { error } from "electron-log";
|
||||
import { t } from "i18next";
|
||||
import React from "react";
|
||||
|
||||
interface InstallationErrorDialogProps {
|
||||
error: string;
|
||||
installationState: string;
|
||||
latestLog: any;
|
||||
retryInstallation: () => void;
|
||||
}
|
||||
|
||||
const InstallationErrorDialog = ({
|
||||
error,
|
||||
installationState,
|
||||
latestLog,
|
||||
retryInstallation,
|
||||
}:InstallationErrorDialogProps) => {
|
||||
return (
|
||||
<Dialog open={installationState == "error"}>
|
||||
<DialogContent className="bg-white-100%">
|
||||
<DialogHeader>
|
||||
<DialogTitle>{t("layout.installation-failed")}</DialogTitle>
|
||||
</DialogHeader>
|
||||
<div className="text-text-label text-xs font-normal leading-tight mb-4">
|
||||
{
|
||||
<div className="mb-1">
|
||||
<span className="text-text-label/60">
|
||||
Error: {error} <br />
|
||||
Log: {latestLog?.data}
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<DialogFooter>
|
||||
<Button onClick={retryInstallation}>{t("layout.retry")}</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
};
|
||||
|
||||
export default InstallationErrorDialog;
|
||||
Loading…
Add table
Add a link
Reference in a new issue