fix: Correct typo in snippet path name
This commit is contained in:
parent
02f81adaf3
commit
2eb8cff6e3
@ -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,
|
||||
|
||||
@ -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 %}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user