import{c as s,F as n,b as a,t as r,a as x,w as y,o as i,h as b,g as d,a5 as c,a6 as m,d as f,i as g,j as h}from"./app-CYVHboi-.js";import{_ as v}from"./Modal-oUJ1UwGv.js";const w={key:0,class:""},_={class:"border-b border-gray-200 p-4 font-bold dark:border-gray-700"},j={class:"m-6 flow-root"},V={class:"overflow-x-auto"},C={class:"inline-block min-w-full rounded-md border border-gray-200 align-middle dark:border-gray-700"},k={class:"min-w-full"},A={class:"divide-y divide-gray-200 dark:divide-gray-700"},B={class:"w-1/3 py-2 ps-4 pe-3 text-end text-sm"},F={class:"py-2 ps-3 pe-4 text-sm font-bold"},N={key:1},O={class:"text-mute"},S={__name:"ViewCustomFields",props:{title:String,modal:{type:Boolean,default:!0},extra_attributes:{type:Object,default:()=>({})}},setup(t){const l=h(!1);return(u,o)=>Object.keys(t.extra_attributes).length?(i(),s("div",w,[t.modal?(i(),s(n,{key:0},[a("button",{type:"button",onClick:o[0]||(o[0]=()=>l.value=!0),class:"-my-1 rounded-md border border-gray-200 px-2 py-0.5 dark:border-gray-700"},r(u.$t("View")),1),x(d(v),{show:l.value,maxWidth:"lg",closeable:!0,onClose:o[1]||(o[1]=()=>l.value=!1)},{default:y(()=>[a("div",_,r(u.$t("Custom Fields"))+" "+r(t.title?" ("+t.title+")":""),1),a("div",j,[a("div",V,[a("div",C,[a("table",k,[a("tbody",A,[(i(!0),s(n,null,b(Object.keys(t.extra_attributes),e=>(i(),s("tr",{key:e},[a("td",B,r(e),1),a("td",F,r(Array.isArray(t.extra_attributes[e])?t.extra_attributes[e].join(", "):d(c)(t.extra_attributes[e])?d(m)(t.extra_attributes[e]):t.extra_attributes[e]||""),1)]))),128))])])])])])]),_:1},8,["show"])],64)):(i(),s("div",N,[(i(!0),s(n,null,b(Object.keys(t.extra_attributes),e=>(i(),s("div",{key:e},[a("span",O,r(e),1),f(" : "+r(Array.isArray(t.extra_attributes[e])?t.extra_attributes[e].join(", "):d(c)(t.extra_attributes[e])?d(m)(t.extra_attributes[e]):t.extra_attributes[e]||""),1)]))),128))]))])):g("",!0)}};export{S as _};
