"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[1810],{91810:(B,h,e)=>{e.r(h),e.d(h,{default:()=>y});var a=e(74848),_=e(32196),d=e(96540),E=e(40845),m=e(63021),g=e(40675),v=e(29158),s=e(67061),r=e(60029),c=e(10354),M=e(71259),u=e(90182),x=e(94354),i=e(55852),O=e(48840),D=e(39938),n=e(8484),P=e(35108),p=e(90141);function y({onClear:t=()=>{}}){const l=(0,E.of)(C),[o,j]=(0,d.useState)("custom"),A=(0,d.useMemo)(()=>(0,a.jsx)(P.B,{showOn:"click",placement:"bottom-start",content:(0,a.jsxs)("div",{className:l.content,children:[o==="custom"&&(0,a.jsx)(f,{}),o==="saved"&&(0,a.jsx)(K,{})]}),header:(0,a.jsxs)(m.U,{hideBorder:!0,className:l.fixTabsMargin,children:[(0,a.jsx)(g.o,{active:o==="custom",icon:"filter",label:"Custom filter",onChangeTab:()=>j("custom")}),(0,a.jsx)(g.o,{active:o==="saved",icon:"bookmark",label:"Saved searches",onChangeTab:()=>j("saved")})]}),children:(0,a.jsx)(v.K,{name:"filter","aria-label":"Show filters"})}),[o,l.content,l.fixTabsMargin]);return(0,a.jsxs)(s.B,{direction:"column",gap:0,children:[(0,a.jsx)(r.J,{children:(0,a.jsx)(n.x6,{i18nKey:"common.search",children:"Search"})}),(0,a.jsx)(s.B,{direction:"row",children:(0,a.jsx)(c.p,{prefix:A})})]})}const f=()=>(0,a.jsxs)(s.B,{direction:"column",alignItems:"end",gap:2,children:[(0,a.jsxs)(M.x,{columns:2,gap:2,alignItems:"center",children:[(0,a.jsx)(r.J,{children:(0,a.jsx)(n.x6,{i18nKey:"alerting.search.property.namespace",children:"Folder / Namespace"})}),(0,a.jsx)(u.l6,{options:[],onChange:()=>{}}),(0,a.jsx)(r.J,{children:(0,a.jsx)(n.x6,{i18nKey:"alerting.search.property.rule-name",children:"Alerting rule name"})}),(0,a.jsx)(c.p,{}),(0,a.jsx)(r.J,{children:(0,a.jsx)(n.x6,{i18nKey:"alerting.search.property.evaluation-group",children:"Evaluation group"})}),(0,a.jsx)(c.p,{}),(0,a.jsx)(r.J,{children:(0,a.jsx)(n.x6,{i18nKey:"alerting.search.property.labels",children:"Labels"})}),(0,a.jsx)(c.p,{}),(0,a.jsx)(r.J,{children:(0,a.jsx)(n.x6,{i18nKey:"alerting.search.property.data-source",children:"Data source"})}),(0,a.jsx)(u.l6,{options:[],onChange:()=>{}}),(0,a.jsx)(r.J,{children:(0,a.jsx)(n.x6,{i18nKey:"alerting.search.property.state",children:"State"})}),(0,a.jsx)(x.z,{value:"*",options:[{label:"All",value:"*"},{label:"Normal",value:"normal"},{label:"Pending",value:"pending"},{label:"Firing",value:"firing"}]}),(0,a.jsx)(r.J,{children:(0,a.jsx)(n.x6,{i18nKey:"alerting.search.property.rule-type",children:"Type"})}),(0,a.jsx)(x.z,{value:"*",options:[{label:"All",value:"*"},{label:"Alert rule",value:"alerting"},{label:"Recording rule",value:"recording"}]}),(0,a.jsx)(r.J,{children:(0,a.jsx)(n.x6,{i18nKey:"alerting.search.property.rule-health",children:"Health"})}),(0,a.jsx)(x.z,{value:"*",options:[{label:"All",value:"*"},{label:"OK",value:"ok"},{label:"No data",value:"no_data"},{label:"Error",value:"error"}]})]}),(0,a.jsxs)(s.B,{direction:"row",alignItems:"center",children:[(0,a.jsx)(i.$n,{variant:"secondary",children:(0,a.jsx)(n.x6,{i18nKey:"common.clear",children:"Clear"})}),(0,a.jsx)(i.$n,{children:(0,a.jsx)(n.x6,{i18nKey:"common.apply",children:"Apply"})})]})]}),K=()=>{const t=(0,d.useCallback)(l=>{},[]);return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(s.B,{direction:"column",gap:2,alignItems:"flex-end",children:[(0,a.jsx)(i.$n,{variant:"secondary",size:"sm",children:(0,a.jsx)(n.x6,{i18nKey:"alerting.search.save-query",children:"Save current search"})}),(0,a.jsx)(O.j,{columns:[{id:"name",header:"Saved search name",cell:({row:l})=>(0,a.jsxs)(s.B,{alignItems:"center",children:[l.original.name,l.original.default?(0,a.jsx)(D.E,{text:"Default",color:"blue"}):null]})},{id:"actions",cell:({row:l})=>(0,a.jsxs)(s.B,{direction:"row",alignItems:"center",children:[(0,a.jsx)(i.$n,{variant:"secondary",fill:"outline",size:"sm",onClick:()=>t(l.original.name),children:(0,a.jsx)(n.x6,{i18nKey:"common.apply",children:"Apply"})}),(0,a.jsx)(p.A,{size:"sm",fill:"outline"})]})}],data:[{name:"My saved search",default:!0},{name:"Another saved search"},{name:"This one has a really long name and some emojis too \u{1F952}"}],getRowId:l=>l.name}),(0,a.jsx)(i.$n,{variant:"secondary",children:(0,a.jsx)(n.x6,{i18nKey:"common.close",children:"Close"})})]})})};function C(t){return{content:(0,_.css)({padding:t.spacing(1),maxWidth:500}),fixTabsMargin:(0,_.css)({marginTop:t.spacing(-1)})}}}}]);

//# sourceMappingURL=1810.ac728b425ee2ede10e2c.js.map