import { useCallback } from 'react';
import * as need from 'lib/need';
import { Box, Row, Button, Icon } from '@tlon/indigo-react';
import { useRollerStore } from 'store/rollerStore';
import { usePointCursor } from 'store/pointCursor';
import { useLocalRouter } from 'lib/LocalRouter';
import { isGalaxy } from 'lib/utils/point';
import Window from 'components/L2/Window/Window';
import HeaderPane from 'components/L2/Window/HeaderPane';
import BodyPane from 'components/L2/Window/BodyPane';
import View from 'components/View';
import L2BackHeader from 'components/L2/Headers/L2BackHeader';
import './Ops.scss';
export const Ops = () => {
const { pop, push, popAndPush, names }: any = useLocalRouter();
const { pointCursor }: any = usePointCursor();
const { point } = useRollerStore();
const _point = need.point(pointCursor);
const goSenate = useCallback(() => push(names.SENATE), [push, names]);
const goResidents = useCallback(() => push(names.RESIDENTS), [push, names]);
const goRequests = useCallback(() => push(names.REQUESTS), [push, names]);
const goIssuePoint = useCallback(() => push(names.ISSUE_CHILD), [
names.ISSUE_CHILD,
push,
]);
const goUrbitOS = useCallback(() => popAndPush(names.URBIT_OS), [
names.URBIT_OS,
popAndPush,
]);
const getButtonContent = () => {
if (!point.couldSpawn) {
return null;
} else if (point.networkKeysSet) {
return (
);
}
return (
);
};
return (
}>
{isGalaxy(_point) ? 'Galaxy' : 'Star'} Ops
{getButtonContent()}
Residents
{isGalaxy(_point) ? 'Stars' : 'Planets'} that you route packets
for
Requests
{isGalaxy(_point) ? 'Stars' : 'Planets'} requesting your
sponsorship
{point.isGalaxy && (
Proposals
View or vote on proposals in the Senate
)}
);
};