import { CSSProperties } from 'react'

export type Palette = {
  primary: string
  secondary: string
  error: string
}

export type ThemeProps = {
  palette?: Palette
}

export interface CustomPaletteTypes extends CSSProperties {
  '--will-primary'?: string
  '--will-secondary'?: string
  '--will-error'?: string
}

export const useTheme = ({ palette }: ThemeProps) => {
  const themePalette: CustomPaletteTypes = {
    '--will-primary': palette?.primary,
    '--will-secondary': palette?.secondary,
    '--will-error': palette?.error,
  }

  return themePalette
}
