import*as e from"react";import{H2 as i,Dropdown as l,DropdownMenu as m,OverflowMenuHorizontalIcon as p,Button as c}from"@redocly/theme";import{Flex as s}from"@redocly/portal-legacy-ui";import{useTranslate as u}from"../../../../../client/app/hooks";import{DeleteAppDialog as d}from"./DeleteAppDialog";import{EditAppDialog as f}from"./EditAppDialog";function g(r){const a=e.useRef(null),t=e.useRef(null),{app:n}=r,{translate:o}=u();return e.createElement(s,{alignItems:"flex-start",justifyContent:"space-between",mb:"1.5rem"},e.createElement("div",null,e.createElement(i,{style:{marginBottom:"0.5rem"}},n.name)),e.createElement(l,{trigger:e.createElement(c,{variant:"text",icon:e.createElement(p,{size:"24px"})}),alignment:"end"},e.createElement(m,{items:[{onAction:()=>a.current.open(),content:o("dev.app.edit","Edit"),dataAttributes:{"data-translation-key":"dev.app.edit"}},{onAction:()=>t.current.open(),content:o("dev.app.delete","Delete"),dataAttributes:{"data-translation-key":"dev.app.delete"}}]})),e.createElement(f,{ref:a,appName:n.name,appDisplayName:n.name}),e.createElement(d,{ref:t}))}function A(r){const a={day:"numeric",month:"short",year:"numeric"},t=new Date(parseInt(r,10));let n=Math.abs(t-Date.now())<60*60*24*1e3;return t.toLocaleString("en-US",{...a,...n?{hour:"numeric",minute:"numeric"}:{}})}export{g as default,A as getReadableDate};
