MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / SQLTab

Function SQLTab

web/pgadmin/static/js/SchemaView/SQLTab.jsx:17–40  ·  view source on GitHub ↗
({active, getSQLValue})

Source from the content-addressed store, hash-verified

15
16// Optional SQL tab.
17export function SQLTab({active, getSQLValue}) {
18 const [sql, setSql] = useState('Loading...');
19 useEffect(() => {
20 let unmounted = false;
21 if(active) {
22 setSql('Loading...');
23 getSQLValue().then((value) => {
24 if(!unmounted) {
25 setSql(value);
26 }
27 });
28 }
29 return () => {unmounted=true;};
30 }, [active]);
31
32 return <InputSQL
33 value={sql}
34 options={{
35 readOnly: true,
36 }}
37 readonly={true}
38 className='FormView-sqlTabInput'
39 />;
40}
41
42SQLTab.propTypes = {
43 active: PropTypes.bool,

Callers

nothing calls this directly

Calls 1

getSQLValueFunction · 0.70

Tested by

no test coverage detected