import { Gtk } from 'astal/gtk3';
import { bind } from 'astal/binding';
import AstalNetwork from 'gi://AstalNetwork?version=0.1';
import { connecting, getFilteredWirelessAPs, isWifiEnabled, staging, wifiAccessPoints } from './helpers';
import { AccessPoint } from './AccessPoint';
import { Controls } from './Controls';
import { Variable } from 'astal';
export const WirelessAPs = (): JSX.Element => {
const wapBinding = Variable.derive(
[bind(staging), bind(connecting), bind(wifiAccessPoints), bind(isWifiEnabled)],
() => {
const filteredWAPs = getFilteredWirelessAPs();
if (filteredWAPs.length <= 0 && staging.get() === undefined) {
return (
);
}
return (
{filteredWAPs.map((ap: AstalNetwork.AccessPoint) => {
return (
);
})}
);
},
);
return (
{
wapBinding.drop();
}}
>
{wapBinding()}
);
};