selectAction(card.id)}
+ onClick={() => select(card.id)}
>

flipped);
const [open, setOpen] = useState(false);
diff --git a/components/Settings.tsx b/components/Settings.tsx
index ce5a83d..08d7a00 100644
--- a/components/Settings.tsx
+++ b/components/Settings.tsx
@@ -4,12 +4,13 @@ import { useState } from 'react';
import { Settings as Gear } from 'lucide-react';
import { Cinzel_Decorative } from 'next/font/google';
+import { useAppContext } from '@/app/AppContext';
import BuyMeACoffee from '@/components/BuyMeACoffee';
import CopyButton from '@/components/CopyButton';
import GitHubButton from '@/components/GitHubButton';
import Scrim from '@/components/Scrim';
import Switch from '@/components/Switch';
-import { CardStyle, GameUpdate } from '@/types';
+import { CardStyle } from '@/types';
const cinzel = Cinzel_Decorative({
variable: '--font-cinzel',
@@ -17,18 +18,17 @@ const cinzel = Cinzel_Decorative({
weight: '400',
});
-type SettingsProps = {
- gameData: GameUpdate;
- changeAction: (updatedSettings: GameUpdate) => void;
-};
-
const cardStyleOptions: CardStyle[] = ['standard', 'color', 'grayscale'];
-export default function Settings({ gameData, changeAction }: SettingsProps) {
+export default function Settings() {
const [open, setOpen] = useState(false);
+ const { gameData, handleSettings } = useAppContext();
+
+ const { dmID } = gameData;
+ const isDM = !!dmID;
const togglePermission = (key: string) => {
- changeAction({
+ handleSettings({
...gameData,
settings: {
...gameData.settings,
@@ -38,7 +38,7 @@ export default function Settings({ gameData, changeAction }: SettingsProps) {
};
const tuneRadio = (cardStyle: CardStyle) => {
- changeAction({
+ handleSettings({
...gameData,
settings: {
...gameData.settings,
@@ -104,7 +104,7 @@ export default function Settings({ gameData, changeAction }: SettingsProps) {
);
- return (
+ return isDM ? (
setOpen((prev) => !prev)}
@@ -129,5 +129,5 @@ export default function Settings({ gameData, changeAction }: SettingsProps) {
- );
+ ) : null;
}
diff --git a/components/SpectatorLink.tsx b/components/SpectatorLink.tsx
new file mode 100644
index 0000000..9b24b23
--- /dev/null
+++ b/components/SpectatorLink.tsx
@@ -0,0 +1,19 @@
+'use client';
+
+import { Eye } from 'lucide-react';
+import { useAppContext } from '@/app/AppContext';
+import CopyButton from '@/components/CopyButton';
+
+export function SpectatorLink() {
+ const { gameData } = useAppContext();
+
+ return (
+
+ );
+}