import React, { useState } from 'react'; import type { RadioChangeEvent } from 'antd'; import { Button, Radio, Select, Space, Switch } from 'antd'; import type { SelectCommonPlacement } from 'antd/es/_util/motion'; const randomOptions = (count?: number) => { const length = count ?? Math.floor(Math.random() * 5) + 1; // Random 1 ~ 5 options return Array.from({ length }).map((_, index) => ({ value: index, label: `Option ${index}`, })); }; const App: React.FC = () => { const [placement, SetPlacement] = useState('topLeft'); const [open, setOpen] = useState(false); const [options, setOptions] = useState(() => randomOptions(3)); const placementChange = (e: RadioChangeEvent) => { SetPlacement(e.target.value); }; return (
TL TR BL BR setOpen((o) => !o)} />