| 1 |
import { __ } from "../../lib/i18n"; |
| 2 |
import type { BulkActionOption } from "./types"; |
| 3 |
|
| 4 |
/** |
| 5 |
* Returns a default set of bulk status action options based on current statusFilter. |
| 6 |
* This is shared across Activities, Destinations, Difficulty Levels, etc. |
| 7 |
*/ |
| 8 |
export const getDefaultBulkStatusOptions = ( |
| 9 |
statusFilter: string, |
| 10 |
): BulkActionOption[] => { |
| 11 |
const options: BulkActionOption[] = []; |
| 12 |
|
| 13 |
switch (statusFilter) { |
| 14 |
case "publish": |
| 15 |
options.push({ value: "trash", label: __("Move to Trash", "yatra") }); |
| 16 |
options.push({ value: "draft", label: __("Make Draft", "yatra") }); |
| 17 |
break; |
| 18 |
case "draft": |
| 19 |
options.push({ value: "publish", label: __("Make Published", "yatra") }); |
| 20 |
options.push({ value: "trash", label: __("Move to Trash", "yatra") }); |
| 21 |
break; |
| 22 |
case "trash": |
| 23 |
options.push({ value: "publish", label: __("Make Published", "yatra") }); |
| 24 |
options.push({ value: "draft", label: __("Make Draft", "yatra") }); |
| 25 |
options.push({ |
| 26 |
value: "delete", |
| 27 |
label: __("Delete Permanently", "yatra"), |
| 28 |
}); |
| 29 |
break; |
| 30 |
case "all": |
| 31 |
default: |
| 32 |
options.push({ value: "publish", label: __("Make Published", "yatra") }); |
| 33 |
options.push({ value: "draft", label: __("Make Draft", "yatra") }); |
| 34 |
options.push({ value: "trash", label: __("Move to Trash", "yatra") }); |
| 35 |
break; |
| 36 |
} |
| 37 |
|
| 38 |
return options; |
| 39 |
}; |
| 40 |
|