1import{d as h,j as e,a as d}from"./index-4ce00ee7.js";import{g as u}from"./index-7de85521.js";import{t as o}from"./index-51f3a61d.js";import{t as r,a as c,b as m}from"./formatters-cb9ccf71.js";const b=u` 2 mutation DeleteTournamentEventMutation($id: String!) { 3 deleteTournamentEvent(id: $id) { 4 id 5 } 6 } 7`,x=({tournamentEvents:s})=>{const[T]=h.useMutation(b,{onCompleted:()=>{o.toast.success("TournamentEvent deleted")},onError:t=>{o.toast.error(t.message)},refetchQueries:[{query:j}],awaitRefetchQueries:!0}),p=t=>{confirm("Are you sure you want to delete tournamentEvent "+t+"?")&&T({variables:{id:t}})};return e.jsx("div",{className:"rw-segment rw-table-wrapper-responsive",children:e.jsxs("table",{className:"rw-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Golf Club"}),e.jsx("th",{children:"Tournament"}),e.jsx("th",{children:"Competition Type"}),e.jsx("th",{children:"Tournament Format"}),e.jsx("th",{children:"Tournament Payout"}),e.jsx("th",{children:"Tournament Handicap"}),e.jsx("th",{children:"Name"}),e.jsx("th",{children:"Description"}),e.jsx("th",{children:"Start date"}),e.jsx("th",{children:"End date"}),e.jsx("th",{children:"Purse amount"}),e.jsx("th",{children:"Entry fee"}),e.jsx("th",{children:"Number of Rounds"}),e.jsx("th",{children:"Status"}),e.jsx("th",{children:"Start format"}),e.jsx("th",{children:"Â "})]})}),e.jsx("tbody",{children:s.map(t=>{var a,n,i,l;return e.jsxs("tr",{children:[e.jsx("td",{children:r(t.GolfClub.name)}),e.jsx("td",{children:r(t.Tournament.name)}),e.jsx("td",{children:r((a=t==null?void 0:t.TournamentCompetitionType)==null?void 0:a.name)}),e.jsx("td",{children:r((n=t==null?void 0:t.TournamentFormat)==null?void 0:n.name)}),e.jsx("td",{children:r((i=t==null?void 0:t.TournamentPayoutType)==null?void 0:i.name)}),e.jsx("td",{children:r((l=t==null?void 0:t.TournamentHandicapType)==null?void 0:l.name)}),e.jsx("td",{children:r(t.name)}),e.jsx("td",{children:r(t.description)}),e.jsx("td",{children:c(t.startDate)}),e.jsx("td",{children:c(t.endDate)}),e.jsx("td",{children:r(t.purseAmount)}),e.jsx("td",{children:r(t.entryFee)}),e.jsx("td",{children:r(t.numberOfRounds)}),e.jsx("td",{children:m(t.status)}),e.jsx("td",{children:m(t.startFormat)}),e.jsx("td",{children:e.jsxs("nav",{className:"rw-table-actions",children:[e.jsx(d.Link,{to:d.routes.tournamentEventPlayers({eventId:t.id}),title:"Show Event Players",className:"rw-button rw-button-small rw-button-grey",children:"Players"}),e.jsx(d.Link,{to:d.routes.tournamentEventTeams({eventId:t.id}),title:"Show Event Teams",className:"rw-button rw-button-small rw-button-grey",children:"Teams"}
7),e.jsx(d.Link,{to:d.routes.tournamentEvent({id:t.id}),title:"Show tournamentEvent "+t.id+" detail",className:"rw-button rw-button-small",children:"Show"}),e.jsx(d.Link,{to:d.routes.editTournamentEvent({id:t.id}),title:"Edit tournamentEvent "+t.id,className:"rw-button rw-button-small rw-button-blue",children:"Edit"}),e.jsx("button",{type:"button",title:"Delete tournamentEvent "+t.id,className:"rw-button rw-button-small rw-button-red",onClick:()=>p(t.id),children:"Delete"})]})})]},t.id)})})]})})},j=u` 8 query FindTournamentEvents($tournamentId: String!) { 9 tournamentEvents(tournamentId: $tournamentId) { 10 id 11 golfClubId 12 tournamentId 13 tournamentCompetitionTypeId 14 tournamentFormatId 15 tournamentPayoutTypeId 16 tournamentHandicapTypeId 17 name 18 description 19 startDate 20 endDate 21 purseAmount 22 entryFee 23 numberOfRounds 24 status 25 startFormat 26 active 27 createdAt 28 updatedAt 29 GolfClub { 30 name 31 } 32 Tournament { 33 name 34 } 35 TournamentCompetitionType { 36 name 37 } 38 TournamentFormat { 39 name 40 } 41 TournamentPayoutType { 42 name 43 } 44 TournamentHandicapType { 45 name 46 } 47 } 48 } 49`,y=()=>e.jsx("div",{children:"Loading..."}),w=({tournamentEvents:s})=>e.jsx(x,{tournamentEvents:s}),f=({error:s})=>e.jsx("div",{className:"rw-cell-error",children:s==null?void 0:s.message}),N=({tournamentEvents:s})=>e.jsx(x,{tournamentEvents:s}),g=h.createCell({QUERY:j,Loading:y,Empty:w,Failure:f,Success:N,displayName:"TournamentEventsCell"}),S=({tournamentId:s})=>e.jsx(g,{tournamentId:s});export{S 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.