({
direction,
showPremium,
setShowPremium,
showTopics,
setShowTopics,
redirectSite,
setRedirectSite,
})
| 2 | import { Tooltip, Switch, Space } from 'antd'; |
| 3 | |
| 4 | const ProblemsTableControl = ({ |
| 5 | direction, |
| 6 | showPremium, |
| 7 | setShowPremium, |
| 8 | showTopics, |
| 9 | setShowTopics, |
| 10 | redirectSite, |
| 11 | setRedirectSite, |
| 12 | }) => { |
| 13 | return ( |
| 14 | <Space direction={direction}> |
| 15 | <Tooltip |
| 16 | placement="top" |
| 17 | title="Toggle to show/hide problem topics" |
| 18 | > |
| 19 | <Switch |
| 20 | checked={showTopics} |
| 21 | checkedChildren="Show Topics" |
| 22 | unCheckedChildren="Hide Topics" |
| 23 | onChange={(checked) => setShowTopics(checked)} |
| 24 | /> |
| 25 | </Tooltip> |
| 26 | <Tooltip |
| 27 | placement="top" |
| 28 | title="Toggle to show/hide premium problems" |
| 29 | > |
| 30 | <Switch |
| 31 | checked={showPremium} |
| 32 | checkedChildren="Show Premium" |
| 33 | unCheckedChildren="Hide Premium" |
| 34 | onChange={(checked) => setShowPremium(checked)} |
| 35 | /> |
| 36 | </Tooltip> |
| 37 | <Tooltip |
| 38 | placement="top" |
| 39 | title={`Click problem title to redirect to leetcode ${redirectSite === 'cn' ? 'China' : 'global'} site`} |
| 40 | > |
| 41 | <Switch |
| 42 | checked={redirectSite === 'com'} |
| 43 | checkedChildren="Global site" |
| 44 | unCheckedChildren="China site" |
| 45 | onChange={(checked) => setRedirectSite(checked ? 'com' : 'cn')} |
| 46 | /> |
| 47 | </Tooltip> |
| 48 | </Space> |
| 49 | ) |
| 50 | }; |
| 51 | |
| 52 | export default ProblemsTableControl; |
nothing calls this directly
no outgoing calls
no test coverage detected