import { z } from 'zod';
import { checkpointTypeSchema } from '../checkpoint';
import { flagStatusSchema, rgbStatusSchema, screenStatusSchema, speedStatusSchema } from '../hardware';

export const kartHardwareStateSchema = z.object({
  speed: z
    .object({
      status: speedStatusSchema,
      current: z.number(),
      configured: z.number(),
    })
    .nullable(),
  rgb: rgbStatusSchema.nullable(),
  flag: z
    .object({
      status: flagStatusSchema,
      checkpointType: checkpointTypeSchema.nullable(),
      checkpointAddress: z.number().nullable(),
    })
    .nullable(),
  screen: screenStatusSchema.nullable(),
  isConnectedToServer: z.boolean(),
  isSteeringWheelPressed: z.boolean(),
});
