TocStyleSelect.tsx 576 B

1234567891011121314151617181920212223242526
  1. import { Select } from "antd";
  2. const { Option } = Select;
  3. interface IWidget {
  4. style?: string;
  5. onChange?: Function;
  6. }
  7. const TocStyleSelectWidget = ({ style = "default", onChange }: IWidget) => {
  8. return (
  9. <Select
  10. value={style}
  11. style={{ width: 90 }}
  12. loading={false}
  13. onChange={(value: string) => {
  14. if (typeof onChange !== "undefined") {
  15. onChange(value);
  16. }
  17. }}
  18. >
  19. <Option value="default">Default</Option>
  20. <Option value="cscd">CSCD</Option>
  21. </Select>
  22. );
  23. };
  24. export default TocStyleSelectWidget;