|
|
|
@ -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,8 +41,20 @@ const CardActions = ({ moveUp, moveDown, remove }: ActionCardProps) => (
|
|
|
|
|
|
|
|
|
|
const ActionCardAnswer = ({ action, ...props }: { action: ActionAnswer } & ActionCardProps) => {
|
|
|
|
|
return (
|
|
|
|
|
<div class="card tint-blue stack-h center">
|
|
|
|
|
<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 class="stack-h fill-w center">
|
|
|
|
|
<div>
|
|
|
|
|
<strong>Team:</strong> <code>{action.team}</code>
|
|
|
|
|
</div>
|
|
|
|
@ -54,13 +67,26 @@ const ActionCardAnswer = ({ action, ...props }: { action: ActionAnswer } & Actio
|
|
|
|
|
<div class="fill"></div>
|
|
|
|
|
<CardActions {...props} />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const ActionCardJolly = ({ action, ...props }: { action: ActionJolly } & ActionCardProps) => {
|
|
|
|
|
return (
|
|
|
|
|
<div class="card tint-blue stack-h center">
|
|
|
|
|
<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 class="stack-h fill-w center">
|
|
|
|
|
<div>
|
|
|
|
|
<strong>Team:</strong> {action.team}
|
|
|
|
|
</div>
|
|
|
|
@ -70,6 +96,7 @@ const ActionCardJolly = ({ action, ...props }: { action: ActionJolly } & ActionC
|
|
|
|
|
<div class="fill"></div>
|
|
|
|
|
<CardActions {...props} />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|