-
-
- setFormat(value as ExportFormat)
- }
- >
-
-
-
-
-
-
-
-
-
-
+
+ {!isExporting && (
+ <>
+
+
+ {
+ if (isExportFormat(value)) {
+ setFormat(value);
+ }
+ }}
+ >
+
+
+
+
+
+
+
+
+
+
-
-
- setQuality(value as ExportQuality)
- }
- >
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ {
+ if (isExportQuality(value)) {
+ setQuality(value);
+ }
+ }}
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
- setIncludeAudio(!!checked)
- }
- />
-
-
-
-
+
+
+
+ setIncludeAudio(!!checked)
+ }
+ />
+
+
+
+
-
- >
- )}
+
+ >
+ )}
- {isExporting && (
-
-
-
-
- {Math.round(progress * 100)}%
-
-
100%
-
-
-
+ {isExporting && (
+
+
+
+
+ {Math.round(progress * 100)}%
+
+
100%
+
+
+
+
+
+
+ )}
+
+ >
+ )}
+
+ );
+}
+
+function isExportFormat(value: string): value is ExportFormat {
+ return EXPORT_FORMAT_VALUES.some((formatValue) => formatValue === value);
+}
-
-