fleet/frontend/components/TableContainer/DataTable/DropdownCell/DropdownCell.tsx
Jahziel Villasana-Espinoza 2833c80cfe
feat: add option to disable scripts (#15815)
> 📜 Related issue: https://github.com/fleetdm/fleet/issues/14500

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [x] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality
2024-01-03 10:42:08 -05:00

37 lines
788 B
TypeScript

import React from "react";
// ignore TS error for now until these are rewritten in ts.
// @ts-ignore
import Dropdown from "components/forms/fields/Dropdown";
import { IDropdownOption } from "interfaces/dropdownOption";
const baseClass = "dropdown-cell";
interface IDropdownCellProps {
options: IDropdownOption[];
placeholder: string;
onChange: (value: string) => void;
disabled?: boolean;
}
const DropdownCell = ({
options,
placeholder,
onChange,
disabled,
}: IDropdownCellProps): JSX.Element => {
return (
<div className={baseClass}>
<Dropdown
onChange={onChange}
placeholder={placeholder}
searchable={false}
options={options}
disabled={disabled ?? false}
/>
</div>
);
};
export default DropdownCell;