| 1 |
import React from "react"; |
| 2 |
import { __ } from "@wordpress/i18n"; |
| 3 |
import Select from "react-select"; |
| 4 |
|
| 5 |
// Bulk-action picker shared by the Doc Categories & Doc Tags tables. Rendered |
| 6 |
// with react-select — reusing the FAQ Builder "Order" dropdown styling |
| 7 |
// (`betterdocs-dropdown` classNamePrefix) — so its open menu list matches the |
| 8 |
// FAQ Builder instead of the browser's native, unstyleable <select> popup. |
| 9 |
const BulkActionsSelect = ({ value, onChange }) => { |
| 10 |
const options = [ |
| 11 |
{ value: "", label: __("Bulk actions", "betterdocs") }, |
| 12 |
{ value: "delete", label: __("Delete", "betterdocs") }, |
| 13 |
]; |
| 14 |
|
| 15 |
return ( |
| 16 |
<div className="betterdocs-dropdown-wrapper bd-dc-bulk-order"> |
| 17 |
<Select |
| 18 |
className="betterdocs-dropdown-select" |
| 19 |
classNamePrefix="betterdocs-dropdown" |
| 20 |
value={options.find((o) => o.value === value) || options[0]} |
| 21 |
options={options} |
| 22 |
onChange={(opt) => onChange(opt?.value || "")} |
| 23 |
isSearchable={false} |
| 24 |
isClearable={false} |
| 25 |
menuPlacement="bottom" |
| 26 |
/> |
| 27 |
</div> |
| 28 |
); |
| 29 |
}; |
| 30 |
|
| 31 |
export default BulkActionsSelect; |
| 32 |
|