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