import { Button } from '@/components/Button'; import { Icon } from '@/components/Icon'; import { WebApplication } from '@/ui_models/application'; import { AppState } from '@/ui_models/app_state'; import { FunctionComponent } from 'preact'; import { useCallback, useState } from 'preact/hooks'; import { PreferencesGroup, PreferencesSegment, Subtitle, Text, Title, } from '../../components'; type Props = { application: WebApplication; appState: AppState; }; export const CheckIcon: React.FC = () => { return ; }; const Migration3dot0dot0: FunctionComponent = ({ application }) => { const [loading, setLoading] = useState(false); const [complete, setComplete] = useState(false); const [error, setError] = useState(null); const trigger = useCallback(() => { setLoading(true); setError(null); setComplete(false); application .migrateTagDotsToHierarchy() .then(() => { setLoading(false); setError(null); setComplete(true); }) .catch((error: unknown) => { setLoading(false); setError(error); setComplete(false); }); }, [application, setLoading, setError]); return ( <> (3.0.0) Folders Component to Native Folders This migration transform tags with "." in their title into a hierarchy of parents. This lets your transform tag hierarchies created with the folder component into native tag folders. {complete && ( Migration successful. )} {error && ( Something wrong happened. Please contact support. )} > ); }; export const Migrations: FunctionComponent = ({ application, appState, }) => { const hasNativeFoldersEnabled = appState.features.enableNativeFoldersFeature; if (!hasNativeFoldersEnabled) { return null; } const hasFoldersFeature = appState.features.hasFolders; if (!hasFoldersFeature) { return null; } return ( Migrations ); };