fix: Correct typo in snippet path name

This commit is contained in:
Gauthier Daniels 2025-04-13 16:57:16 +02:00
parent 02f81adaf3
commit 2eb8cff6e3
2 changed files with 13 additions and 3 deletions

View File

@ -18,9 +18,19 @@ export function Snippet({
showLineNumbers: boolean;
}) {
const { snippets } = useData<Data>();
const snippet = snippets.find((snippet) => snippet.path === path);
if (!snippet || !snippet.content) return null;
if (!snippet || !snippet.content) {
return (
<div className="bg-red-600/10 p-4 rounded-md flex items-center justify-center">
<p className="text-red-500 text-center">
<b className="uppercase">Snippet introuvable</b>
<br />
<code>{path}</code>
</p>
</div>
);
}
const props = {
language,

View File

@ -97,7 +97,7 @@ Ensuite, on va définir notre état initial :
{% tabs defaultSelectedTab="js" %}
{% tab value="js" label="JavaScript" %}
{% snippet path="react/reducer/reducer-initial-state.js" language="js" /%}
{% snippet path="react/reducer/reducer-initial-statse.js" language="js" /%}
{% /tab %}