+ {description}
+
+ {/* LANGUAGE */}
+
+ Language
+ {language}
+
+
+ {/* CREATED AT */}
+
+ Created
+ {creationDate.relative}
+
+
+ {/* UPDATED AT */}
+
+ Last updated
+ {updateDate.relative}
+
+
+
+
+ {/* ACTIONS */}
+
+
+
+
+
+
+
+
+
+ {/* COPY */}
+
+
+
+
+ );
+};
diff --git a/client/src/components/Snippets/SnippetForm.tsx b/client/src/components/Snippets/SnippetForm.tsx
index 9724fde..4fb830f 100644
--- a/client/src/components/Snippets/SnippetForm.tsx
+++ b/client/src/components/Snippets/SnippetForm.tsx
@@ -1,10 +1,23 @@
-import { ChangeEvent, FormEvent, Fragment, useState, useContext } from 'react';
+import {
+ ChangeEvent,
+ FormEvent,
+ Fragment,
+ useState,
+ useContext,
+ useEffect
+} from 'react';
import { SnippetsContext } from '../../store';
import { NewSnippet } from '../../typescript/interfaces';
import { Button, Card } from '../UI';
-export const SnippetForm = (): JSX.Element => {
- const { createSnippet } = useContext(SnippetsContext);
+interface Props {
+ inEdit?: boolean;
+}
+
+export const SnippetForm = (props: Props): JSX.Element => {
+ const { inEdit = false } = props;
+ const { createSnippet, currentSnippet, updateSnippet } =
+ useContext(SnippetsContext);
const [formData, setFormData] = useState