MCPcopy Create free account
hub / github.com/bunnyxt/lcid / ProblemsTableControl

Function ProblemsTableControl

src/components/ProblemsTableControl.jsx:4–50  ·  view source on GitHub ↗
({
  direction,
  showPremium,
  setShowPremium,
  showTopics,
  setShowTopics,
  redirectSite,
  setRedirectSite,
})

Source from the content-addressed store, hash-verified

2import { Tooltip, Switch, Space } from 'antd';
3
4const 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
52export default ProblemsTableControl;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected