|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
import { sendJSON } from '@/client/utils'
|
|
|
|
|
import type { Room } from '@/db/model'
|
|
|
|
|
import type { Action, ActionAnswer, ActionJolly } from '@/ggwp'
|
|
|
|
|
import { format } from 'date-fns'
|
|
|
|
|
import { type Dispatch, type StateUpdater } from 'preact/hooks'
|
|
|
|
|
|
|
|
|
|
type ActionCardProps = {
|
|
|
|
@ -40,35 +41,61 @@ const CardActions = ({ moveUp, moveDown, remove }: ActionCardProps) => (
|
|
|
|
|
|
|
|
|
|
const ActionCardAnswer = ({ action, ...props }: { action: ActionAnswer } & ActionCardProps) => {
|
|
|
|
|
return (
|
|
|
|
|
<div class="card tint-blue stack-h center">
|
|
|
|
|
<div class="chip">Risposta</div>
|
|
|
|
|
<div>
|
|
|
|
|
<strong>Team:</strong> <code>{action.team}</code>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<strong>Domanda:</strong> <code>{action.question}</code>
|
|
|
|
|
<div class="card tint-blue stack-v start">
|
|
|
|
|
<div class="stack-h center">
|
|
|
|
|
<div class="chip">Risposta</div>
|
|
|
|
|
<div class="stack-h center gap-sm">
|
|
|
|
|
<div class="icon">schedule</div>
|
|
|
|
|
<div class="text dimmed">
|
|
|
|
|
{action.timestamp && format(new Date(action.timestamp), 'dd/MM/yyyy HH:mm:ss')}
|
|
|
|
|
<span class="text smaller">
|
|
|
|
|
{action.timestamp && ' ' + format(new Date(action.timestamp), 'SSS')}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<strong>Risultato:</strong> <code>{action.outcome}</code>
|
|
|
|
|
<div class="stack-h fill-w center">
|
|
|
|
|
<div>
|
|
|
|
|
<strong>Team:</strong> <code>{action.team}</code>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<strong>Domanda:</strong> <code>{action.question}</code>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<strong>Risultato:</strong> <code>{action.outcome}</code>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="fill"></div>
|
|
|
|
|
<CardActions {...props} />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="fill"></div>
|
|
|
|
|
<CardActions {...props} />
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const ActionCardJolly = ({ action, ...props }: { action: ActionJolly } & ActionCardProps) => {
|
|
|
|
|
return (
|
|
|
|
|
<div class="card tint-blue stack-h center">
|
|
|
|
|
<div class="chip">Jolly</div>
|
|
|
|
|
<div>
|
|
|
|
|
<strong>Team:</strong> {action.team}
|
|
|
|
|
<div class="card tint-blue stack-v start">
|
|
|
|
|
<div class="stack-h center">
|
|
|
|
|
<div class="chip">Jolly</div>
|
|
|
|
|
<div class="stack-h center gap-sm">
|
|
|
|
|
<div class="icon">schedule</div>
|
|
|
|
|
<div class="text dimmed">
|
|
|
|
|
{action.timestamp && format(new Date(action.timestamp), 'dd/MM/yyyy HH:mm:ss')}
|
|
|
|
|
<span class="text smaller">
|
|
|
|
|
{action.timestamp && ' ' + format(new Date(action.timestamp), 'SSS')}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<strong>Problem:</strong> {action.group}
|
|
|
|
|
<div class="stack-h fill-w center">
|
|
|
|
|
<div>
|
|
|
|
|
<strong>Team:</strong> {action.team}
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<strong>Problem:</strong> {action.group}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="fill"></div>
|
|
|
|
|
<CardActions {...props} />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="fill"></div>
|
|
|
|
|
<CardActions {...props} />
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|