1import{r as d,g as N,j as n,e,c as o,F as c,h as r,Q as f,f as b,I as y}from"./index-c165adff.js";import{P as F}from"./PageLinks-155d1c81.js";const x={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ModStoriesQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"search"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"page"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchWorldStories"},arguments:[{kind:"Argument",name:{kind:"Name",value:"langCode"},value:{kind:"StringValue",value:"en",block:!1}},{kind:"Argument",name:{kind:"Name",value:"search"},value:{kind:"Variable",name:{kind:"Name",value:"search"}}},{kind:"Argument",name:{kind:"Name",value:"page"},value:{kind:"Variable",name:{kind:"Name",value:"page"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"results"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"favoriteCount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"world"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"draftName"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"count"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"pageSize"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:295,source:{body:` 2 query ModStoriesQuery($search: String, $page: Int!) { 3 searchWorldStories(langCode: "en", search: $search, page: $page) { 4 results { 5 id 6 title 7 favoriteCount 8 world { 9 id 10 draftName 11 } 12 } 13 count 14 pageSize 15 } 16 } 17`,name:"GraphQL request",locationOffset:{line:1,column:1}}}},m=()=>window.scrollTo(0,0),V=()=>{const[u,h]=d.useState(""),[k,l]=d.useState(""),[s,v]=d.useState(1),{data:a,loading:g}=N(x,{variables:{search:u,page:s}});return n(c,{children:[e(b.Metadata,{title:"Stories",description:"Stories mod page"}),e("h1",{children:"Stories"}),n("div",{css:o` 18 display: flex; 19 flex-flow: row nowrap; 20 margin-bottom: 1.5rem; 21 .space { 22 flex: auto; 23 } 24 `,children:[e("div",{className:"space"}),e(y,{value:k,onInput:l,search:!0,placeholder:"Search",onEnter:i=>{l(i),h(i),m()}})]}),g&&e("p",{children:"Loading..."}),a&&n(c,{children:[n("table",{className:"table-data",css:o` 25 width: 100%; 26 `,children:[e("thead",{children:n("tr",{children:[e("th",{children:"#"}),e("th",{children:"Title"}),e("th",{children:"World"}),e("th",{children:"Favorites"}),e("th",{})]})}),n("tbody",{children:[a.searchWorldStories.results.length===0&&e("tr",{children:e("td",{colSpan:4,children:e("p",{children:"No results"})})}),a.searchWorldStories.results.map(({id:i,title:S,favoriteCount:p,world:t})=>n("tr",{children:[e("td",{children:e("code",{children:i.substr(-6)})}),e("td",{children:S||e("em",{children:"No title"})}),e("td",{children:e(r.Link,{to:r.routes.worldView({langCode:"en",name:f(t.draftName),id:t.id}),children:t.draftName||t.id})}),e("td",{children:p}),e("td",{children:e(r.Link,{to:r.routes.contentModStoryDetail({id:i}),className:"btn",children:"More"})})]},i))]})]}),e(F,{buffer:3,page:s,count:a.searchWorldStories.count,pageSize:a.searchWorldStories.pageSize,onClick:i=>{v(i),m()}})]})]})};export{V as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.