-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make a reset mode and an error to explain to user the error and…
… propose a link to reset
- Loading branch information
Showing
3 changed files
with
48 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
"use client"; // Error components must be Client Components | ||
|
||
export default function Error({ error, reset: _reset }: { error: Error & { digest?: string }; reset: () => void }) { | ||
return ( | ||
<div className="col-start-2 mt-4 p-8"> | ||
<p>Erreur du playground</p> | ||
|
||
<p className="text-red-500">{error.message}</p> | ||
|
||
<p>Vous pouvez recharger le playground. </p> | ||
<p>Attention : toutes les données seront supprimées de votre navigateur.</p> | ||
|
||
<p> | ||
Pour ne pas perdre votre travail en cours, vous pouvez copier le contenu MDX ci-dessous, et corriger à la main | ||
en se basant sur l'erreur remontée. | ||
</p> | ||
|
||
<details> | ||
<summary>Détails</summary> | ||
|
||
<p> | ||
<pre>{localStorage.getItem("mdxContent")}</pre> | ||
</p> | ||
</details> | ||
|
||
<div className="mt-8"> | ||
<a href={`/mdx/playground?reset=true`}>Recharger le playground</a> | ||
</div> | ||
{/* <button | ||
onClick={ | ||
// Attempt to recover by trying to re-render the segment | ||
() => reset() | ||
} | ||
> | ||
Try again | ||
</button> */} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters