hypnagaga/docs/assets/Table-fbca1480.js
2023-11-07 14:23:03 +00:00

3 lines
1.6 KiB
JavaScript

import{R as e,r as o}from"./index-d020bb23.js";import{U as u}from"./chunk-S4VUQJ4A-05193691.js";const E="_title_13v0c_1",d="_table_13v0c_31",s={title:E,table:d},y=t=>t.children.split(`
`).map(a=>e.createElement("div",{key:a},a)),b=t=>{const a=async l=>{const n=typeof l.copyable[l.column]=="function"?l.copyable[l.column](`${l.children}`):`${l.children}`;await navigator.clipboard.writeText(n),m(!0)},[c,m]=o.useState(!1);let r;return o.useEffect(()=>{r&&clearTimeout(r),r=setTimeout(()=>{m(!1)},1e3)},[c]),t.copyable&&t.copyable[t.column]?e.createElement("button",{className:"copy-btn",onClick:()=>a(t)},e.createElement("span",{className:"material-symbols-outlined"},"content_copy"),t.children,c&&e.createElement("div",{className:"copy-tag"},"Copied")):e.createElement(y,null,t.children)},h=t=>e.createElement("td",null,e.createElement(b,{...t},t.children)),f=t=>e.createElement("tr",null,t.children.map((a,c)=>e.createElement(h,{...t,column:c,key:c},a))),C=t=>e.createElement("th",null,t.children),v=({title:t=null,note:a=null,header:c,body:m,copyable:r,mdnLink:l=null})=>e.createElement(u,null,e.createElement("div",{className:s.title},t,t&&l&&e.createElement("a",{href:`https://developer.mozilla.org/en-US/docs/Web/CSS/${l}`,target:"_blank"},e.createElement("span",{className:"material-symbols-outlined"},"link")),a&&e.createElement("p",null,a)),e.createElement("table",{className:s.table},e.createElement("thead",null,e.createElement("tr",null,c.map(n=>e.createElement(C,{key:n},n)))),e.createElement("tbody",null,m.map((n,i)=>e.createElement(f,{title:t,header:c,body:m,copyable:r,mdnLink:l,key:i},n)))));export{v as C};
//# sourceMappingURL=Table-fbca1480.js.map