| 1 |
import { __, _n, sprintf } from "@wordpress/i18n"; |
| 2 |
import React from "react"; |
| 3 |
|
| 4 |
import { ReactComponent as Directions } from "./assets/images/all-directions.svg"; |
| 5 |
import { ReactComponent as Delete } from "./assets/images/delete.svg"; |
| 6 |
import { ReactComponent as Edit } from "./assets/images/edit.svg"; |
| 7 |
import { ReactComponent as Magic } from "./assets/images/magic.svg"; |
| 8 |
|
| 9 |
/** |
| 10 |
* Design-accurate, inert mock of Pro's Glossaries screen. It exists only to sit |
| 11 |
* blurred behind the lock panel, so nothing here fetches or reacts — it renders |
| 12 |
* the very same `bd-faq-ctg-*` card markup (drag handle, title, "Available in N |
| 13 |
* docs" pill, edit / AI / delete actions, status toggle, accordion) and the same |
| 14 |
* SVG icons the real Glossaries screen uses (components/Glossary.js), so the |
| 15 |
* blurred picture matches the real screen exactly. |
| 16 |
*/ |
| 17 |
|
| 18 |
const ChevronIcon = () => ( |
| 19 |
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" aria-hidden="true"> |
| 20 |
<path d="M4 5.5L7 8.5L10 5.5" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round" /> |
| 21 |
</svg> |
| 22 |
); |
| 23 |
|
| 24 |
const TERMS = [ |
| 25 |
{ name: __( "API", "betterdocs" ), count: 47 }, |
| 26 |
{ name: __( "Endpoint", "betterdocs" ), count: 12 }, |
| 27 |
{ name: __( "Knowledge Base", "betterdocs" ), count: 8 }, |
| 28 |
{ name: __( "OAuth", "betterdocs" ), count: 6 }, |
| 29 |
{ name: __( "Rate Limit", "betterdocs" ), count: 5 }, |
| 30 |
{ name: __( "SLA", "betterdocs" ), count: 4 }, |
| 31 |
{ name: __( "Webhook", "betterdocs" ), count: 3 } |
| 32 |
]; |
| 33 |
|
| 34 |
export default function GlossaryMock() { |
| 35 |
return ( |
| 36 |
<div className="bd-gloss-mock"> |
| 37 |
<div className="bd-faq-ctg-list"> |
| 38 |
<div className="bd-faq-ctg-list-droppable"> |
| 39 |
{ TERMS.map( ( t, i ) => ( |
| 40 |
<div className="bd-faq-ctg" key={ i }> |
| 41 |
<div className="bd-faq-ctg-head"> |
| 42 |
<button type="button" className="bd-faq-button-reset bd-faq-ctg-drag-button" tabIndex={ -1 }> |
| 43 |
<Directions /> |
| 44 |
</button> |
| 45 |
<h3 className="bd-faq-ctg-title"> |
| 46 |
{ t.name } |
| 47 |
<span> |
| 48 |
{ sprintf( |
| 49 |
_n( "Available in %d doc", "Available in %d docs", t.count, "betterdocs" ), |
| 50 |
t.count |
| 51 |
) } |
| 52 |
</span> |
| 53 |
</h3> |
| 54 |
<button type="button" className="bd-faq-button-reset bd-faq-action-button" tabIndex={ -1 }> |
| 55 |
<Edit /> |
| 56 |
</button> |
| 57 |
<button type="button" className="bd-faq-button-reset bd-faq-action-button magic-icon" tabIndex={ -1 }> |
| 58 |
<Magic /> |
| 59 |
</button> |
| 60 |
<button type="button" className="bd-faq-button-reset bd-faq-action-button" tabIndex={ -1 }> |
| 61 |
<Delete /> |
| 62 |
</button> |
| 63 |
<span className="bd-faq-toggler"> |
| 64 |
<input type="checkbox" checked readOnly className="checkbox" /> |
| 65 |
<span className="knobs"></span> |
| 66 |
<span className="layer"></span> |
| 67 |
</span> |
| 68 |
<button type="button" className="bd-faq-button-reset bd-faq-accordion-icon" tabIndex={ -1 }> |
| 69 |
<ChevronIcon /> |
| 70 |
</button> |
| 71 |
</div> |
| 72 |
</div> |
| 73 |
) ) } |
| 74 |
</div> |
| 75 |
</div> |
| 76 |
</div> |
| 77 |
); |
| 78 |
} |
| 79 |
|