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