diff --git a/src/app/routes/api/files/$collection/$recordId/$file.ts b/src/app/routes/api/files/$collection/$recordId/$file.ts index 581e1fb..e058f42 100644 --- a/src/app/routes/api/files/$collection/$recordId/$file.ts +++ b/src/app/routes/api/files/$collection/$recordId/$file.ts @@ -5,7 +5,7 @@ export const ServerRoute = createServerFileRoute("/api/files/$collection/$record GET: async ({ params, request }) => { try { const { collection, recordId, file } = params; - const pocketbaseUrl = process.env.VITE_POCKETBASE_URL || 'http://127.0.0.1:8090'; + const pocketbaseUrl = process.env.POCKETBASE_URL || 'http://127.0.0.1:8090'; const fileUrl = `${pocketbaseUrl}/api/files/${collection}/${recordId}/${file}`; logger.info('File proxy', { diff --git a/src/features/admin/components/admin-page.tsx b/src/features/admin/components/admin-page.tsx index 10036ce..bb5eb67 100644 --- a/src/features/admin/components/admin-page.tsx +++ b/src/features/admin/components/admin-page.tsx @@ -19,7 +19,7 @@ const AdminPage = () => { label="Open Pocketbase" Icon={DatabaseIcon} onClick={() => - window.location.replace(import.meta.env.VITE_POCKETBASE_URL! + "/_/") + window.location.replace(process.env.POCKETBASE_URL! + "/_/") } /> = ({ showControls, }) => { return ( - + {rounds.map((round, roundIndex) => ( = ({ pos="relative" gap={24} justify="space-around" + p={24} > {round .filter((match) => !match.bye) diff --git a/src/features/bracket/components/match-card.tsx b/src/features/bracket/components/match-card.tsx index f6377a8..5addac5 100644 --- a/src/features/bracket/components/match-card.tsx +++ b/src/features/bracket/components/match-card.tsx @@ -1,5 +1,5 @@ import { ActionIcon, Card, Flex, Text, Stack, Indicator } from "@mantine/core"; -import { PlayIcon, PencilIcon } from "@phosphor-icons/react"; +import { PlayIcon, PencilIcon, SpeakerHighIcon } from "@phosphor-icons/react"; import React, { useCallback, useMemo } from "react"; import { MatchSlot } from "./match-slot"; import { Match } from "@/features/matches/types"; @@ -91,6 +91,31 @@ export const MatchCard: React.FC = ({ [match.id, editSheet] ); + const handleSpeakerClick = useCallback(() => { + if ('speechSynthesis' in window && match.home?.name && match.away?.name) { + const utterance = new SpeechSynthesisUtterance( + `${match.home.name} vs. ${match.away.name}` + ); + + const voices = window.speechSynthesis.getVoices(); + + const preferredVoice = voices.find(voice => + voice.lang.startsWith('en') && + voice.name.includes('Daniel') + ) || voices.find(voice => voice.lang.startsWith('en') && voice.default); + + if (preferredVoice) { + utterance.voice = preferredVoice; + } + + utterance.rate = 0.9; + utterance.volume = 0.8; + utterance.pitch = 1.0; + + window.speechSynthesis.speak(utterance); + } + }, [match.home?.name, match.away?.name]); + return ( @@ -131,6 +156,18 @@ export const MatchCard: React.FC = ({ * If necessary )} + + + + diff --git a/src/features/spotify/components/spotify-controls-bar.tsx b/src/features/spotify/components/spotify-controls-bar.tsx index e2bb294..f54e35b 100644 --- a/src/features/spotify/components/spotify-controls-bar.tsx +++ b/src/features/spotify/components/spotify-controls-bar.tsx @@ -45,7 +45,7 @@ const SpotifyControlsBar = () => { - Connect Spotify to control music during tournaments + Connect Spotify ; constructor() { - this.pb = new PocketBase(import.meta.env.VITE_POCKETBASE_URL); + this.pb = new PocketBase(process.env.POCKETBASE_URL); this.pb.beforeSend = (url, options) => { options.cache = "no-store"; @@ -38,8 +38,8 @@ class PocketBaseAdminClient { await this.pb .collection("_superusers") .authWithPassword( - import.meta.env.VITE_POCKETBASE_ADMIN_EMAIL!, - import.meta.env.VITE_POCKETBASE_ADMIN_PASSWORD! + process.env.POCKETBASE_ADMIN_EMAIL!, + process.env.POCKETBASE_ADMIN_PASSWORD! ); } } diff --git a/src/lib/supertokens/server.ts b/src/lib/supertokens/server.ts index a8a8c09..77b9aa7 100644 --- a/src/lib/supertokens/server.ts +++ b/src/lib/supertokens/server.ts @@ -12,7 +12,7 @@ export const backendConfig = (): TypeInput => { framework: "custom", supertokens: { connectionURI: - import.meta.env.VITE_SUPERTOKENS_URI || "https://try.supertokens.io", + process.env.SUPERTOKENS_URI || "https://try.supertokens.io", }, appInfo, recipeList: [ diff --git a/src/lib/twilio/index.ts b/src/lib/twilio/index.ts index e1d972c..eb35b73 100644 --- a/src/lib/twilio/index.ts +++ b/src/lib/twilio/index.ts @@ -1,8 +1,8 @@ import twilio from "twilio"; -const accountSid = import.meta.env.VITE_TWILIO_ACCOUNT_SID; -const authToken = import.meta.env.VITE_TWILIO_AUTH_TOKEN; -const serviceSid = import.meta.env.VITE_TWILIO_SERVICE_SID; +const accountSid = process.env.TWILIO_ACCOUNT_SID!; +const authToken = process.env.TWILIO_AUTH_TOKEN!; +const serviceSid = process.env.TWILIO_SERVICE_SID!; const client = twilio(accountSid, authToken);