1 line
1.7 KiB
JavaScript
1 line
1.7 KiB
JavaScript
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{G as t,I as n,N as r,on as i}from"./semi-65W_4I1v.js";import{A as a,T as o,j as s,x as c}from"./assetTarget-D2PEjBAg.js";import{t as l}from"./react-QV7DAAIx.js";var u=e(l(),1),{Text:d}=t;function f({text:e,max:t=42,className:n=``,placeholder:r=`—`}){let a=String(e??``).trim();if(!a)return(0,u.jsx)(d,{type:`tertiary`,children:r});if(a.length<=t)return(0,u.jsx)(`span`,{className:n,children:a});let o=`${a.slice(0,t)}…`;return(0,u.jsx)(i,{content:a,position:`topLeft`,children:(0,u.jsx)(`span`,{className:n,children:o})})}function p({asset:e,size:t=`small`}){let n=s(e);return(0,u.jsx)(r,{size:t,color:c[n]||`grey`,shape:`circle`,children:a(n)})}function m({status:e,size:t=`small`}){let n=String(e||`active`).toLowerCase();return(0,u.jsx)(r,{size:t,color:n===`inactive`?`grey`:`green`,shape:`square`,children:o[n]||e||`—`})}function h({protocol:e,port:t,size:i=`small`}){let a=String(e||``).trim(),o=Number(t||0)>0?`:${t}`:``;return!a&&!o?(0,u.jsx)(d,{type:`tertiary`,children:`—`}):(0,u.jsxs)(n,{spacing:4,children:[a?(0,u.jsx)(r,{size:i,color:`blue`,shape:`square`,children:a}):null,o?(0,u.jsx)(d,{type:`tertiary`,size:`small`,children:o}):null]})}function g({tags:e,max:t=3}){let a=Array.isArray(e)?e.filter(Boolean):[];if(!a.length)return(0,u.jsx)(d,{type:`tertiary`,children:`—`});let o=a.slice(0,t),s=a.slice(t);return(0,u.jsxs)(n,{spacing:4,wrap:!0,children:[o.map(e=>(0,u.jsx)(r,{size:`small`,color:`violet`,shape:`square`,children:e},e)),s.length?(0,u.jsx)(i,{content:s.join(`、`),children:(0,u.jsx)(`span`,{children:(0,u.jsxs)(r,{size:`small`,shape:`square`,children:[`+`,s.length]})})}):null]})}export{f as a,g as i,h as n,p as r,m as t}; |