(null as unknown as Entry)
const ApplicationListItem = memo(({ entry }: { entry: Entry }) => (
{entry.name}
{entry.stages.map((step) => (
))}
))
const StageItem = memo(({ step }: { step: string }) => {
const entry = useContext(EntryContext)
const deleteStageInEntry = useStore((state) => state.deleteStageInEntry)
return (
{step}
{step !== DEFAULT_NODE.applicationSubmittedNode.key ? (
) : null}
)
})
function NewStageInput() {
const isAddingStage = useListItemStore((state) => state.isAddingStage)
if (isAddingStage) {
return (
)
}
return null
}
function ActualStageInput() {
const newStageValue = useListItemStore((state) => state.newStageValue)
const setNewStageValue = useListItemStore((state) => state.setNewStageValue)
return (
{
setNewStageValue(event.currentTarget.value)
}}
className="bg-transparent"
/>
)
}
function ApplicationActions() {
const isAddingStage = useListItemStore((state) => state.isAddingStage)
if (isAddingStage) {
return
}
return
}
const DefaultActions = memo(() => {
const entry = useContext(EntryContext)
const setIsAddingStage = useListItemStore((state) => state.setIsAddingStage)
const deleteEntry = useStore((state) => state.deleteEntry)
function onDeleteApplication() {
if (confirm("Are you sure you want to delete this application?")) {
deleteEntry(entry.name)
}
}
return (
)
})
const AddStageActions = memo(() => {
const entry = useContext(EntryContext)
const setIsAddingStage = useListItemStore((state) => state.setIsAddingStage)
const setNewStageValue = useListItemStore((state) => state.setNewStageValue)
const addStageToEntry = useStore((state) => state.addStageInEntry)
function onOk() {
const stage = useListItemStore.getState().newStageValue
if (stage) {
addStageToEntry(stage, entry.name)
setIsAddingStage(false)
setNewStageValue("")
}
}
function onCancel() {
setIsAddingStage(false)
}
return (
)
})
export { ApplicationList }