Open History to see the last commit
1import { formEventClient } from '@tanstack/form-core'
2β
3import { useStyles } from '../styles/use-styles'
4β
5import type { Accessor } from 'solid-js'
6import type { DevtoolsFormState } from '../contexts/eventClientContext'
7β
8type ActionButtonsProps = {
9 selectedInstance: Accessor<DevtoolsFormState | null | undefined>
10}
11β
12export function ActionButtons(props: ActionButtonsProps) {
13 const styles = useStyles()
14β
15 return (
16 <div class={styles().actionsRow}>
17 <button
18 class={styles().actionButton}
19 onMouseDown={() => {
20 formEventClient.emit('request-form-state', {
21 id: props.selectedInstance()?.id as string,
22 })
23 }}
24 >
25 <span class={styles().actionDotGreen} />
26 Flush
27 </button>
28β
29 <button
30 class={styles().actionButton}
31 onMouseDown={() => {
32 formEventClient.emit('request-form-reset', {
33 id: props.selectedInstance()?.id as string,
34 })
35 }}
36 >
37 <span class={styles().actionDotRed} />
38 Reset
39 </button>
40β
41 <button
42 class={styles().actionButton}
43 onMouseDown={() => {
44 formEventClient.emit('request-form-force-submit', {
45 id: props.selectedInstance()?.id as string,
46 })
47 }}
48 >
49 <span class={styles().actionDotYellow} />
50 Submit (-f)
51 </button>
52 </div>
53 )
54}