//
// Copyright 2021 DXOS.org
//
import React from 'react';
import { Button } from '@dxos/react-ui';
import { humanize } from '@dxos/util';
import { BooleanIcon } from '../../../components';
// TODO(burdon): Convert to Table.
export const SwarmTable = ({ swarms, onClick }) => (React.createElement("div", { className: 'flex flex-col grow bs-screen is-full' },
    React.createElement("div", { className: 'inline-flex is-full border-be border-separator' },
        React.createElement("div", { className: 'flex is-[30rem]' }, "Label"),
        React.createElement("div", { className: 'flex is-[30rem]' }, "Topic"),
        React.createElement("div", { className: 'flex is-[30rem]' }, "Active"),
        React.createElement("div", { className: 'flex is-[30rem]' }, "Info")),
    React.createElement("div", null, swarms.map((swarm) => (React.createElement("div", { key: swarm.id.toHex(), className: 'inline-flex is-full border-be border-separator' },
        React.createElement("div", { className: 'flex is-[30rem] overflow-hidden' }, swarm.label && humanize(swarm.label)),
        React.createElement("div", { className: 'flex is-[30rem] overflow-hidden' }, humanize(swarm.topic)),
        React.createElement("div", { className: 'flex is-[30rem] m-1' },
            React.createElement(BooleanIcon, { value: swarm.isActive ? true : undefined })),
        React.createElement("div", { className: 'flex is-[30rem] overflow-hidden ' },
            React.createElement(Button, { onClick: () => {
                    onClick?.(swarm.id);
                } }, "Info"))))))));
//# sourceMappingURL=SwarmTable.js.map