diff --git a/components/SelectTags.tsx b/components/SelectTags.tsx index 7e1426e..8c1ac94 100644 --- a/components/SelectTags.tsx +++ b/components/SelectTags.tsx @@ -1,6 +1,6 @@ import React, { useMemo } from 'react'; import { useMyVariable } from '../context/MyVariableContext'; -import debounce from 'lodash/debounce'; +import { debounce } from 'lodash'; import CreatableSelect from 'react-select/creatable'; import { saveNewTags } from '../utils/saveNewTags' @@ -11,7 +11,7 @@ interface SelectTagsProps { } const SelectTags: React.FC = ({ onSelect, initialValue, type }) => { - let initialOptions = initialValue ? initialValue.split(", ").map((val: any) => ({ label: val, value: val })) : []; + let initialOptions = initialValue ? initialValue.split(", ").map((val) => ({ label: val, value: val })) : []; const [selectedLabels, setSelectedLabels] = React.useState(initialOptions); const { myVariable } = useMyVariable(); const options = myVariable.tags[`${type}`] || [ diff --git a/components/SummaryAgendaItems.tsx b/components/SummaryAgendaItems.tsx index d23613e..af40989 100644 --- a/components/SummaryAgendaItems.tsx +++ b/components/SummaryAgendaItems.tsx @@ -53,7 +53,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => { // Utility to add an entire new "agenda item" section const addAgendaItem = () => { - setAgendaItems((prev) => [ + setAgendaItems((prev: any) => [ ...prev, { ...getDefaultAgendaItem() } ]); @@ -61,7 +61,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => { // Remove one entire "agenda item" section const removeAgendaItem = (index: number) => { - setAgendaItems((prev) => { + setAgendaItems((prev: any) => { const updated = [...prev]; updated.splice(index, 1); return updated; @@ -70,7 +70,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => { // Add a sub‐item (actionItems, discussionPoints, etc.) const addItem = (type: string, agendaIndex: number) => { - setAgendaItems((prev) => { + setAgendaItems((prev: any) => { const updated = [...prev]; // Ensure the target array exists; if not, initialize it. @@ -103,7 +103,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => { // Remove a sub‐item const removeItem = (type: string, agendaIndex: number, itemIndex: number) => { - setAgendaItems((prev) => { + setAgendaItems((prev: any) => { const updated = [...prev]; updated[agendaIndex][type].splice(itemIndex, 1); return updated; @@ -117,7 +117,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => { itemIdx: number, updatedItem: any ) => { - setAgendaItems((prev) => { + setAgendaItems((prev: any) => { const cloned = JSON.parse(JSON.stringify(prev)); // Some fields (narrative, discussion, etc.) are single text fields @@ -152,7 +152,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => { item={item.townHallUpdates} agendaIndex={agendaIndex} itemIndex={0} - onUpdate={(aIdx, iIdx, updated) => + onUpdate={(aIdx: any, iIdx: any, updated: any) => handleItemUpdate("townHallUpdates", aIdx, iIdx, updated) } onRemove={removeItem} @@ -173,7 +173,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => { item={item.narrative} agendaIndex={agendaIndex} itemIndex={0} - onUpdate={(aIdx, iIdx, updated) => + onUpdate={(aIdx: any, iIdx: any, updated: any) => handleItemUpdate("narrative", aIdx, iIdx, updated) } onRemove={removeItem} @@ -194,7 +194,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => { item={item.discussion} agendaIndex={agendaIndex} itemIndex={0} - onUpdate={(aIdx, iIdx, updated) => + onUpdate={(aIdx: any, iIdx: any, updated: any) => handleItemUpdate("discussion", aIdx, iIdx, updated) } onRemove={removeItem} @@ -217,7 +217,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => { item={topic} agendaIndex={agendaIndex} itemIndex={idx} - onUpdate={(aIdx, iIdx, updated) => + onUpdate={(aIdx: any, iIdx: any, updated: any) => handleItemUpdate("meetingTopics", aIdx, iIdx, updated) } onRemove={removeItem} @@ -248,7 +248,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => { item={pt} agendaIndex={agendaIndex} itemIndex={idx} - onUpdate={(aIdx, iIdx, updated) => + onUpdate={(aIdx: any, iIdx: any, updated: any) => handleItemUpdate("discussionPoints", aIdx, iIdx, updated) } onRemove={removeItem} @@ -278,7 +278,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => { item={action} agendaIndex={agendaIndex} itemIndex={actionIdx} - onUpdate={(aIdx, iIdx, updated) => + onUpdate={(aIdx: any, iIdx: any, updated: any) => handleItemUpdate("actionItems", aIdx, iIdx, updated) } onRemove={removeItem} @@ -307,7 +307,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => { item={dec} agendaIndex={agendaIndex} itemIndex={decIdx} - onUpdate={(aIdx, iIdx, updated) => + onUpdate={(aIdx: any, iIdx: any, updated: any) => handleItemUpdate("decisionItems", aIdx, iIdx, updated) } onRemove={removeItem} @@ -335,7 +335,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => { item={item.gameRules} agendaIndex={agendaIndex} itemIndex={0} - onUpdate={(aIdx, iIdx, updated) => + onUpdate={(aIdx: any, iIdx: any, updated: any) => handleItemUpdate("gameRules", aIdx, iIdx, updated) } onRemove={removeItem} @@ -356,7 +356,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => { item={item.townHallSummary} agendaIndex={agendaIndex} itemIndex={0} - onUpdate={(aIdx, iIdx, updated) => + onUpdate={(aIdx: any, iIdx: any, updated: any) => handleItemUpdate("townHallSummary", aIdx, iIdx, updated) } onRemove={removeItem} @@ -379,7 +379,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => { item={lb} agendaIndex={agendaIndex} itemIndex={lbIdx} - onUpdate={(aIdx, iIdx, updated) => + onUpdate={(aIdx: any, iIdx: any, updated: any) => handleItemUpdate("leaderboard", aIdx, iIdx, updated) } onRemove={removeItem} @@ -410,7 +410,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => { item={lp} agendaIndex={agendaIndex} itemIndex={lpIdx} - onUpdate={(aIdx, iIdx, updated) => + onUpdate={(aIdx: any, iIdx: any, updated: any) => handleItemUpdate("learningPoints", aIdx, iIdx, updated) } onRemove={removeItem} @@ -441,7 +441,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => { item={issue} agendaIndex={agendaIndex} itemIndex={issueIdx} - onUpdate={(aIdx, iIdx, updated) => + onUpdate={(aIdx: any, iIdx: any, updated: any) => handleItemUpdate("issues", aIdx, iIdx, updated) } onRemove={removeItem} diff --git a/components/SummaryMeetingInfo.tsx b/components/SummaryMeetingInfo.tsx index 58d403b..56fe70b 100644 --- a/components/SummaryMeetingInfo.tsx +++ b/components/SummaryMeetingInfo.tsx @@ -96,13 +96,15 @@ const SummaryMeetingInfo: React.FC = ({ workgroup, onUp }, [meetingInfo.purpose]); // Generic handler for top-level text fields - const handleChange = (e: React.ChangeEvent) => { + const handleChange = ( + e: React.ChangeEvent + ) => { const { name, value } = e.target; setMeetingInfo((prev) => ({ ...prev, [name]: value, })); - }; + }; useEffect(() => { onUpdate(meetingInfo); diff --git a/components/SummaryTemplate.tsx b/components/SummaryTemplate.tsx index 68c7139..5b5f59f 100644 --- a/components/SummaryTemplate.tsx +++ b/components/SummaryTemplate.tsx @@ -1,6 +1,6 @@ // ../components/SummaryTemplate.tsx import { useState, useEffect, useMemo, useRef } from "react"; -import debounce from "lodash/debounce"; +import { debounce } from 'lodash'; import isEqual from "lodash/isEqual"; import styles from '../styles/summarytemplate.module.css'; import { useMyVariable } from '../context/MyVariableContext'; diff --git a/package-lock.json b/package-lock.json index 0721c9c..8e0c38b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,8 @@ }, "devDependencies": { "@netlify/plugin-nextjs": "^5.9.4", - "@types/lodash": "^4.17.15" + "@types/lodash": "^4.17.15", + "@types/react-modal": "^3.16.3" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -971,6 +972,16 @@ "@types/react": "*" } }, + "node_modules/@types/react-modal": { + "version": "3.16.3", + "resolved": "https://registry.npmjs.org/@types/react-modal/-/react-modal-3.16.3.tgz", + "integrity": "sha512-xXuGavyEGaFQDgBv4UVm8/ZsG+qxeQ7f77yNrW3n+1J6XAstUy5rYHeIHPh1KzsGc6IkCIdu6lQ2xWzu1jBTLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/react": "*" + } + }, "node_modules/@types/react-transition-group": { "version": "4.4.7", "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.7.tgz", diff --git a/package.json b/package.json index 200ab32..b59dbe7 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ }, "devDependencies": { "@netlify/plugin-nextjs": "^5.9.4", - "@types/lodash": "^4.17.15" + "@types/lodash": "^4.17.15", + "@types/react-modal": "^3.16.3" } }