mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-22 08:50:56 +02:00

There are two problems with the current localization strategy: - We download the translations on-demand, which means that it does a serial roundtrip for nothing. - withTranslation helper actually renders the app 3 times on startup, instead of once (I haven't tried to debug it)
33 lines
756 B
TypeScript
33 lines
756 B
TypeScript
import React from "react";
|
|
import { PreviousScene } from "../scene/types";
|
|
import { t } from "../i18n";
|
|
|
|
interface StoredScenesListProps {
|
|
scenes: PreviousScene[];
|
|
currentId?: string;
|
|
onChange: (selectedId: string) => {};
|
|
}
|
|
|
|
export function StoredScenesList({
|
|
scenes,
|
|
currentId,
|
|
onChange,
|
|
}: StoredScenesListProps) {
|
|
return (
|
|
<React.Fragment>
|
|
<select
|
|
className="stored-ids-select"
|
|
onChange={({ currentTarget }) => onChange(currentTarget.value)}
|
|
value={currentId}
|
|
title={t("buttons.previouslyLoadedScenes")}
|
|
>
|
|
{scenes.map(scene => (
|
|
<option key={scene.id} value={scene.id}>
|
|
id={scene.id}
|
|
</option>
|
|
))}
|
|
</select>
|
|
</React.Fragment>
|
|
);
|
|
}
|