Add Champions WC 26 community demo#400
Open
AyanBhardwaj1 wants to merge 2 commits into
Open
Conversation
Comment on lines
+7
to
+13
| export async function GET(_: Request, context: { params: Promise<{ id: string }> }) { | ||
| const { id } = await context.params; | ||
| const run = getRun(id); | ||
| return run | ||
| ? NextResponse.json(run) | ||
| : NextResponse.json({ error: "Run not found." }, { status: 404 }); | ||
| } |
| const [selectedTeam, setSelectedTeam] = useState(""); | ||
| const [error, setError] = useState(""); | ||
| const [loading, setLoading] = useState(false); | ||
| const groups = useMemo(() => Object.groupBy(field as FieldTeam[], (team) => team.group), []); |
| </button> | ||
| ))} | ||
| </div> | ||
| {!eligiblePlayers.length && <div className="inline-error"><CircleAlert size={15} /> No player in this roster fits your remaining slots. This squad is skipped automatically.</div>} |
Comment on lines
+9
to
+22
| export const metadata: Metadata = { | ||
| metadataBase: new URL("http://localhost:3000"), | ||
| title: { default: "Champions (WC 26)", template: "%s · Champions (WC 26)" }, | ||
| description: "Play Classic Wheel or World Cup Era, reveal your Squad DNA and chase a perfect 8–0 at World Cup 2026.", | ||
| applicationName: "Champions (WC 26)", | ||
| openGraph: { | ||
| title: "Champions (WC 26)", | ||
| description: "Two ways to build history. One perfect 8–0.", | ||
| type: "website", | ||
| images: [{ url: "/og-modes.png", width: 1200, height: 630, alt: "Champions WC 26 — Classic Wheel, World Cup Era and Moss Squad DNA" }], | ||
| }, | ||
| twitter: { card: "summary_large_image", title: "Champions (WC 26)", description: "Two ways to build history. One perfect 8–0.", images: ["/og-modes.png"] }, | ||
| icons: { icon: "/icon" }, | ||
| }; |
Comment on lines
+23
to
+31
| export function saveRun(result: TournamentResult) { | ||
| const id = crypto.randomUUID().slice(0, 8); | ||
| const stored = { ...result, id }; | ||
| db.prepare(` | ||
| INSERT INTO runs (id, created_at, replaced_team, formation, champion, perfect, result_json) | ||
| VALUES (?, ?, ?, ?, ?, ?, ?) | ||
| `).run(id, result.createdAt, result.replacedTeam, result.formation, result.champion ? 1 : 0, result.perfect ? 1 : 0, JSON.stringify(stored)); | ||
| return stored; | ||
| } |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Author
|
Comitted changes from Copilot, please merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
Please ensure that your PR meets the following requirements:
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
Fixes # (issue number)
Type of Change