File size: 980 Bytes
b59aa07
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { useTranslation } from "react-i18next";
import { I18nKey } from "#/i18n/declaration";
import { SuggestionBox } from "./suggestion-box";

interface ReplaySuggestionBoxProps {
  onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
}

export function ReplaySuggestionBox({ onChange }: ReplaySuggestionBoxProps) {
  const { t } = useTranslation();
  return (
    <SuggestionBox
      title={t(I18nKey.LANDING$REPLAY)}
      content={
        <label
          htmlFor="import-trajectory"
          className="w-full flex justify-center"
        >
          <span className="border-2 border-dashed border-neutral-600 rounded px-2 py-1 cursor-pointer">
            {t(I18nKey.LANDING$UPLOAD_TRAJECTORY)}
          </span>
          <input
            hidden
            type="file"
            accept="application/json"
            id="import-trajectory"
            multiple={false}
            onChange={onChange}
          />
        </label>
      }
    />
  );
}