diff --git a/src/components/admin/awards/MedalDesigner.tsx b/src/components/admin/awards/MedalDesigner.tsx index 32cf2c8..b49290b 100644 --- a/src/components/admin/awards/MedalDesigner.tsx +++ b/src/components/admin/awards/MedalDesigner.tsx @@ -116,13 +116,20 @@ function MedalBody({ {shape === "circle" && ( - + )} {shape === "star" && ( { - const angle = (Math.PI / 2) + (i * Math.PI) / 5; + const angle = Math.PI / 2 + (i * Math.PI) / 5; const radius = i % 2 === 0 ? r : r * 0.45; return `${cx + radius * Math.cos(angle)},${cy - radius * Math.sin(angle)}`; }).join(" ")} @@ -228,14 +235,7 @@ function MedalPreview({ design }: { design: MedalDesign }) { })()} {/* Small connector tab between ribbon and medal */} - + {/* Medal body */} @@ -424,14 +424,8 @@ export default function MedalDesigner() { (stripes: Stripe[]) => setDesign((d) => ({ ...d, ribbonStripes: stripes })), [], ); - const setShape = useCallback( - (shape: MedalShape) => setDesign((d) => ({ ...d, shape })), - [], - ); - const setFinish = useCallback( - (finish: MetalFinish) => setDesign((d) => ({ ...d, finish })), - [], - ); + const setShape = useCallback((shape: MedalShape) => setDesign((d) => ({ ...d, shape })), []); + const setFinish = useCallback((finish: MetalFinish) => setDesign((d) => ({ ...d, finish })), []); const setEngraving = useCallback( (engraving: string) => setDesign((d) => ({ ...d, engraving })), [], diff --git a/src/components/admin/awards/RibbonDesigner.tsx b/src/components/admin/awards/RibbonDesigner.tsx index c67a001..696d274 100644 --- a/src/components/admin/awards/RibbonDesigner.tsx +++ b/src/components/admin/awards/RibbonDesigner.tsx @@ -79,9 +79,7 @@ function RibbonPreview({ design }: { design: RibbonDesign }) { const { stripes, devices, mirrored } = design; if (stripes.length === 0) return null; - const displayStripes = mirrored - ? [...stripes, ...stripes.slice(0, -1).reverse()] - : stripes; + const displayStripes = mirrored ? [...stripes, ...stripes.slice(0, -1).reverse()] : stripes; const totalWeight = displayStripes.reduce((sum, s) => sum + s.width, 0); const viewWidth = RIBBON_WIDTH; @@ -98,16 +96,7 @@ function RibbonPreview({ design }: { design: RibbonDesign }) { let x = 0; return displayStripes.map((stripe, i) => { const w = (stripe.width / totalWeight) * viewWidth; - const el = ( - - ); + const el = ; x += w; return el; }); @@ -156,9 +145,7 @@ function StripeEditor({ return (
- - Stripes - + Stripes - - - + + Story + + + + + - Data - - - - - - - + + Data + + + + + + + + - Logic - - - - - - - + + Logic + + + + + + + + - {nodes.length} node{nodes.length !== 1 ? "s" : ""}, {edges.length} edge{edges.length !== 1 ? "s" : ""} + {nodes.length} node{nodes.length !== 1 ? "s" : ""}, {edges.length} edge + {edges.length !== 1 ? "s" : ""}
); diff --git a/src/components/admin/narrative-flow/NodeEditDialog.tsx b/src/components/admin/narrative-flow/NodeEditDialog.tsx index de8fadb..f2d1ed3 100644 --- a/src/components/admin/narrative-flow/NodeEditDialog.tsx +++ b/src/components/admin/narrative-flow/NodeEditDialog.tsx @@ -1,12 +1,12 @@ "use client"; -import { useEffect, useState, type FC } from "react"; +import { type FC, useEffect, useState } from "react"; import { Dialog, DialogContent, + DialogFooter, DialogHeader, DialogTitle, - DialogFooter, } from "@/components/ui/dialog"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; @@ -22,12 +22,7 @@ interface NodeEditDialogProps { onSave: (nodeId: string, data: Record) => void; } -export const NodeEditDialog: FC = ({ - node, - open, - onOpenChange, - onSave, -}) => { +export const NodeEditDialog: FC = ({ node, open, onOpenChange, onSave }) => { const [formData, setFormData] = useState>({}); useEffect(() => { @@ -326,10 +321,7 @@ export const NodeEditDialog: FC = ({ variant="outline" size="sm" onClick={() => { - const updated = [ - ...options, - { id: crypto.randomUUID(), label: "" }, - ]; + const updated = [...options, { id: crypto.randomUUID(), label: "" }]; updateField("options", updated); }} className="dark:border-zinc-700 dark:text-zinc-300" @@ -584,11 +576,7 @@ export const NodeEditDialog: FC = ({ case "not": case "branch": case "sequence": { - return ( -

- No configurable properties. -

- ); + return

No configurable properties.

; } default: @@ -620,7 +608,10 @@ export const NodeEditDialog: FC = ({ return ( - + Edit {label} @@ -642,10 +633,7 @@ export const NodeEditDialog: FC = ({ > Cancel - diff --git a/src/components/admin/narrative-flow/NodeShell.tsx b/src/components/admin/narrative-flow/NodeShell.tsx index 17fcc01..8184ea6 100644 --- a/src/components/admin/narrative-flow/NodeShell.tsx +++ b/src/components/admin/narrative-flow/NodeShell.tsx @@ -1,7 +1,7 @@ "use client"; import { Handle, Position } from "@xyflow/react"; -import { SOCKET_COLORS, NODE_SOCKETS, type SocketDef, type SocketType } from "./types"; +import { NODE_SOCKETS, SOCKET_COLORS, type SocketDef } from "./types"; function SocketHandle({ socket, @@ -81,16 +81,12 @@ export function NodeShell({ {/* Input handles - positioned on left edge */} {inputs.map((socket, i) => { const top = maxSlots === 1 ? 50 : (i / (maxSlots - 1)) * 80 + 10; - return ( - - ); + return ; })} {/* Output handles - positioned on right edge */} {outputs.map((socket, i) => { const top = maxSlots === 1 ? 50 : (i / (maxSlots - 1)) * 80 + 10; - return ( - - ); + return ; })} {/* Content area with padding to avoid handle overlap */}
{children}
diff --git a/src/components/admin/narrative-flow/NotNode.tsx b/src/components/admin/narrative-flow/NotNode.tsx index db94c99..14aa7d6 100644 --- a/src/components/admin/narrative-flow/NotNode.tsx +++ b/src/components/admin/narrative-flow/NotNode.tsx @@ -6,7 +6,10 @@ import { NodeShell } from "./NodeShell"; export function NotNode(_props: NodeProps) { return ( - +
NOT diff --git a/src/components/admin/narrative-flow/NumberNode.tsx b/src/components/admin/narrative-flow/NumberNode.tsx index 12b7368..7b7dbdc 100644 --- a/src/components/admin/narrative-flow/NumberNode.tsx +++ b/src/components/admin/narrative-flow/NumberNode.tsx @@ -8,7 +8,10 @@ export function NumberNode({ data }: NodeProps) { const d = data as { value?: number; description?: string }; return ( - +
diff --git a/src/components/admin/narrative-flow/OutcomeNode.tsx b/src/components/admin/narrative-flow/OutcomeNode.tsx index 65f259a..f42a50e 100644 --- a/src/components/admin/narrative-flow/OutcomeNode.tsx +++ b/src/components/admin/narrative-flow/OutcomeNode.tsx @@ -13,7 +13,10 @@ export function OutcomeNode({ data }: NodeProps) { const effects = d.effects ?? []; return ( - +
diff --git a/src/components/admin/narrative-flow/RandomNode.tsx b/src/components/admin/narrative-flow/RandomNode.tsx index 3f70ec7..d8fa20c 100644 --- a/src/components/admin/narrative-flow/RandomNode.tsx +++ b/src/components/admin/narrative-flow/RandomNode.tsx @@ -8,7 +8,10 @@ export function RandomNode({ data }: NodeProps) { const d = data as { min?: number; max?: number; description?: string }; return ( - +
diff --git a/src/components/admin/narrative-flow/SequenceNode.tsx b/src/components/admin/narrative-flow/SequenceNode.tsx index 2fb1273..b7ee352 100644 --- a/src/components/admin/narrative-flow/SequenceNode.tsx +++ b/src/components/admin/narrative-flow/SequenceNode.tsx @@ -6,7 +6,10 @@ import { NodeShell } from "./NodeShell"; export function SequenceNode(_props: NodeProps) { return ( - +
Sequence diff --git a/src/components/admin/narrative-flow/StringNode.tsx b/src/components/admin/narrative-flow/StringNode.tsx index fd49a99..f799c7a 100644 --- a/src/components/admin/narrative-flow/StringNode.tsx +++ b/src/components/admin/narrative-flow/StringNode.tsx @@ -8,7 +8,10 @@ export function StringNode({ data }: NodeProps) { const d = data as { value?: string; description?: string }; return ( - +
diff --git a/src/components/admin/narrative-flow/WaitNode.tsx b/src/components/admin/narrative-flow/WaitNode.tsx index 3bd7b92..3352696 100644 --- a/src/components/admin/narrative-flow/WaitNode.tsx +++ b/src/components/admin/narrative-flow/WaitNode.tsx @@ -8,7 +8,10 @@ export function WaitNode({ data }: NodeProps) { const d = data as { ticks?: number; input?: unknown }; return ( - +