ActiveFile.tsx 735 B

1234567891011121314151617181920212223242526272829
  1. import React from "react";
  2. import Stack from "../components/Stack";
  3. import { ToolButton } from "../components/ToolButton";
  4. import { save, file } from "../components/icons";
  5. import { t } from "../i18n";
  6. import "./ActiveFile.scss";
  7. type ActiveFileProps = {
  8. fileName?: string;
  9. onSave: () => void;
  10. };
  11. export const ActiveFile = ({ fileName, onSave }: ActiveFileProps) => (
  12. <Stack.Row className="ActiveFile" gap={1} align="center">
  13. <span className="ActiveFile__fileName">
  14. {file}
  15. <span>{fileName}</span>
  16. </span>
  17. <ToolButton
  18. type="icon"
  19. icon={save}
  20. title={t("buttons.save")}
  21. aria-label={t("buttons.save")}
  22. onClick={onSave}
  23. data-testid="save-button"
  24. />
  25. </Stack.Row>
  26. );