ActiveFile.tsx 675 B

1234567891011121314151617181920212223
  1. // TODO barnabasmolnar/editor-redesign
  2. // this icon is not great
  3. import { getShortcutFromShortcutName } from "../actions/shortcuts";
  4. import { save } from "../components/icons";
  5. import { t } from "../i18n";
  6. import "./ActiveFile.scss";
  7. import DropdownMenuItem from "./dropdownMenu/DropdownMenuItem";
  8. type ActiveFileProps = {
  9. fileName?: string;
  10. onSave: () => void;
  11. };
  12. export const ActiveFile = ({ fileName, onSave }: ActiveFileProps) => (
  13. <DropdownMenuItem
  14. shortcut={getShortcutFromShortcutName("saveScene")}
  15. dataTestId="save-button"
  16. onSelect={onSave}
  17. icon={save}
  18. ariaLabel={`${t("buttons.save")}`}
  19. >{`${t("buttons.save")}`}</DropdownMenuItem>
  20. );