diff --git a/src/components/RoughScheduleSetting/RoughScheduleSetting.tsx b/src/components/RoughScheduleSetting/RoughScheduleSetting.tsx index bb26b76..4e2d908 100644 --- a/src/components/RoughScheduleSetting/RoughScheduleSetting.tsx +++ b/src/components/RoughScheduleSetting/RoughScheduleSetting.tsx @@ -108,6 +108,20 @@ const RSSOverview: React.FC = ({ items }) => { label: t("Exclude Date"), type: 'multi-select', options: dayOptions, + renderCell: (item: ItemsResult) => { + console.log("[debug] render item", item) + const selectedValues = item.excludeDate as number[] ?? []; // Assuming excludeDate is an array of numbers + const selectedLabels = dayOptions + .filter(option => selectedValues.includes(option.value)) + .map(option => option.label) + .join(", "); // Join labels into a string + + return ( + handleEditClick(item.id as number)}> + {selectedLabels || "None"} {/* Display "None" if no days are selected */} + + ); + }, }, // { // name: "action", diff --git a/src/components/SearchResults/EditableSearchResults.tsx b/src/components/SearchResults/EditableSearchResults.tsx index f3a5e8a..07a7d8f 100644 --- a/src/components/SearchResults/EditableSearchResults.tsx +++ b/src/components/SearchResults/EditableSearchResults.tsx @@ -26,6 +26,7 @@ interface BaseColumn { label: string; type: string; options: T[]; + renderCell? : (T) => void; } interface ColumnWithAction extends BaseColumn { @@ -148,6 +149,7 @@ function EditableSearchResults({ case 'input': return ( handleInputChange(item.id as number, columnName, e.target.value)} @@ -167,9 +169,12 @@ function EditableSearchResults({ } })() ) : ( - handleEditClick(item.id as number)}> - {item[columnName] as string} - + column.renderCell ? + column.renderCell(item) + : + handleEditClick(item.id as number)}> + {item[columnName] as string} + )} );