import { __ } from "@wordpress/i18n"; import React from "react"; /** * Design-accurate, inert mock of Pro's API Docs screen (react-src/admin/api-docs/ * components/ApiTable.js over there). It exists only to sit blurred behind the * lock panel, so nothing here fetches or reacts — it is a picture of the real * table, built from the same `bd-dc-*` table shell Free already ships for Doc * Categories, plus the API-specific column classes in api-docs-teaser.scss. */ const ViewIcon = () => ( ); const EditIcon = () => ( ); const TrashIcon = () => ( ); const REFERENCES = [ { title: "Payments API", source: __( "URL sync", "betterdocs" ), endpoints: 42, published: true }, { title: "Petstore (OpenAPI 3.1)", source: __( "Upload", "betterdocs" ), endpoints: 19, published: true }, { title: "Webhooks Reference", source: __( "URL sync", "betterdocs" ), endpoints: 8, published: true }, { title: "Internal Admin API", source: __( "Upload", "betterdocs" ), endpoints: 27, published: false, postman: true } ]; const METHODS = [ { verb: "GET", path: "/v1/customers/{id}" }, { verb: "POST", path: "/v1/customers" }, { verb: "PATCH", path: "/v1/customers/{id}" }, { verb: "DELETE", path: "/v1/customers/{id}" } ]; export default function ApiDocsMock() { return (
{ __( "Name", "betterdocs" ) }
{ __( "Endpoints", "betterdocs" ) }
{ __( "Status", "betterdocs" ) }
{ __( "Actions", "betterdocs" ) }
{ REFERENCES.map( ( item, i ) => (
{ item.title }
{ item.source } { item.postman && { __( "Postman", "betterdocs" ) } }
{ item.endpoints }
{ item.published ? __( "Published", "betterdocs" ) : __( "Draft", "betterdocs" ) }
{ item.published && }
) ) }
{/* A slice of the rendered reference, so the lock panel's promise ("endpoints become real docs") has a picture attached. */}
{ __( "Payments API", "betterdocs" ) } { __( "OpenAPI 3.1", "betterdocs" ) }
{ METHODS.map( ( m, i ) => (
{ m.verb } { m.path } { __( "Try it", "betterdocs" ) }
) ) }
); }