polen
Version:
A framework for delightful GraphQL developer portals
17 lines • 960 B
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { GrafaidOld } from '#lib/grafaid-old/index';
import { Box, Flex, Heading } from '@radix-ui/themes';
import { Obj } from '@wollybeard/kit';
import { Link } from './Link.js';
export const TypeIndex = ({ schema }) => {
const kindMap = GrafaidOld.getKindMap(schema);
const sections = Obj.entries(kindMap.list);
return (_jsx(Flex, { direction: 'column', gap: '6', children: sections.map(([title, types]) => _jsx(TypeSection, { title: title, types: types }, title)) }));
};
const TypeSection = ({ title, types }) => {
return (_jsxs(Box, { children: [_jsx(Heading, { size: '3', children: title }), _jsx(TypeList, { types: types })] }));
};
const TypeList = ({ types }) => {
return ((_jsx(Box, { children: types.map(type => (_jsx(Box, { children: _jsx(Link, { to: `/reference/${type.name}`, children: type.name }) }, type.name))) })));
};
//# sourceMappingURL=TypeIndex.js.map