Skip to content

Commit

Permalink
Add types to params in inner functions
Browse files Browse the repository at this point in the history
This is not ideal but it has to be lived with
  • Loading branch information
boyonthebeach2k committed Oct 21, 2024
1 parent 9cbec19 commit 72a1db1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/ItemSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const ItemSelector = ({ itemData }: { itemData: ItemDataType }) => {
return;
}

setSelectedItem(itemData[selectedSheet].find((item) => item.name === selectedItem.name)!);
setSelectedItem(itemData[selectedSheet].find((item: { name: string }) => item.name === selectedItem.name)!);
}, [itemData, selectedItem.name, selectedSheet]);

const reset = () => {
Expand Down Expand Up @@ -67,7 +67,7 @@ const ItemSelector = ({ itemData }: { itemData: ItemDataType }) => {
)}
{!selectedItem.name || (selectedItem.name && isExpanded) ? (
<div className={styles.itemImageContainer}>
{itemData[selectedSheet].map((item) => (
{itemData[selectedSheet].map((item: { name: string; image: string }) => (
<Image
key={item.name}
className={styles.itemImage + (item.name === selectedItem.name ? ` ${styles.selectedItem}` : "")}
Expand Down
2 changes: 1 addition & 1 deletion components/ItemTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const ItemTable = ({ selectedItem }: { selectedItem: ItemDataType[(typeof sheetN
</tr>
</thead>
<tbody>
{selectedItem.data.map((row) => (
{selectedItem.data.map((row: { [x: string]: string; Area: string; Quest: string }) => (
<tr key={row["No."]}>
{Object.keys(row).map((key) => {
let data = <>{row[key as keyof typeof row | "No."]}</>;
Expand Down

0 comments on commit 72a1db1

Please sign in to comment.