+
-
+
{appState === AppState.CODE_READY && (
<>
@@ -627,7 +627,7 @@ function App() {
diff --git a/frontend/src/components/SettingsDialog.tsx b/frontend/src/components/SettingsDialog.tsx
index 97d8f38..211191b 100644
--- a/frontend/src/components/SettingsDialog.tsx
+++ b/frontend/src/components/SettingsDialog.tsx
@@ -30,12 +30,30 @@ interface Props {
function SettingsDialog({ settings, setSettings }: Props) {
const handleThemeChange = (theme: EditorTheme) => {
- setSettings((s) => ({
+ setSettings((s: Settings) => ({
...s,
editorTheme: theme,
}));
};
+ const handleFileChange = (event: Event) => {
+ const target= event.target as HTMLInputElement;
+ const file: File = (target.files as FileList)[0];
+ if (file) {
+ const reader = new FileReader();
+ reader.onload = (e) => {
+ const content = e!.target!.result;
+ // Here you can set the file content to the settings
+ console.log(content);
+ setSettings((s: any) => ({
+ ...s,
+ tailwindConfig: content,
+ }));
+ };
+ reader.readAsText(file);
+ }
+ };
+
return (