import { useEffect, useState, CSSProperties } from 'react'; import axios from 'axios'; import { userPreferences } from '../api/api'; import { Button } from './ui'; type previewThemeColors = { bg: string; fg: string; a: string; b: string; } export type themeInfo = { name: string; url: string; dark: previewThemeColors; light: previewThemeColors; } export type themeJSON = themeInfo[]; export default function ThemePicker(props: { preferences?: userPreferences }) { var [ themes, setThemes ] = useState([]); useEffect(() => { axios.request({ method: 'get', url: '/themes/themes.json', }).then(response => { setThemes(response.data); }).catch(err => { console.error(err) }) }, []); return <> {themes.map(theme => )} ; } export function ThemeCard(props: { theme: themeInfo; dark?: boolean }) { var mode = props.dark ? "dark" : "light"; return
}