{
+ if (value === "search") {
+ fetchSnippets();
+ }
+ setActiveTab(value as string);
}}
- justify={"between"}
- align={"start"}
>
-
-
-
- setActiveIds((prev) => ({
- ...prev,
- fileId: parseInt(fileId as string),
- }))
- }
- >
-
- {snippet?.files?.map((t) => (
- {
- if (e.button === 1) {
- setActiveIds((prev) => ({
- ...prev,
- fileId: undefined,
- }));
- }
- }}
- >
- {
- setSnippet((prev) => {
- if (!prev) return null;
- return {
- ...prev,
- files: prev.files.map((f) =>
- f.id === t.id ? { ...f, name: e.target.value } : f
- ),
- };
- });
- }}
- />
-
- ))}
-
-
-
- {snippet?.files?.map((file) => (
-
-
- {
- setSnippet((prev) => {
- if (!prev) return null;
- return {
- ...prev,
- files: prev.files.map((f) =>
- f.id === file.id
- ? { ...f, filetype: e.target.value }
- : f
- ),
- };
- });
+
+
+
- updateSnippetFile(file.id, {
- ...file,
- filetype: e.target.value,
- }).then(() => {});
- }}
- />
-
- ))}
-
-
-
-
-
-