import React from "react"; import { GroupedStatuses, NoteStatus } from "@/types/noteStatus"; import { StatusSelectorGroup, Props as StatusSelectorGroupProps, } from "./StatusSelectorGroup"; export interface Props { currentStatuses: GroupedStatuses; filesQuantity: number; availableStatuses: NoteStatus[]; onRemoveStatus: ( frontmatterTagName: string, status: NoteStatus, ) => Promise; onSelectStatus: ( frontmatterTagName: string, status: NoteStatus, ) => Promise; } export const ChangeStatusModal: React.FC = ({ currentStatuses: initialStatuses, filesQuantity, availableStatuses, onRemoveStatus, onSelectStatus, }) => { const currentStatuses = Object.entries(initialStatuses); const handleSelectedState: StatusSelectorGroupProps["onSelectedState"] = ( frontmatterTagName, status, action, ) => { if (action === "select") { onSelectStatus(frontmatterTagName, status); } else { onRemoveStatus(frontmatterTagName, status); } }; return ( <>

Change note status {filesQuantity}

{currentStatuses.map(([frontmatterTagName, statusList]) => ( ))} ); };