import type { FC } from 'react'; import styles from '../styles.module.css'; export interface ButtonsProps { readonly canDelete: boolean; readonly onAdd: () => void; readonly onRename: () => void; readonly onDelete: () => void; readonly onImport: (file: File) => void; } /** * Button strip on the right of the nav: Add / Import / Rename... / Delete, where * Delete is disabled when there is only one sheet. */ export const Buttons: FC = ({ canDelete, onAdd, onRename, onDelete, onImport, }) => { const handleFileChange = (e: React.ChangeEvent): void => { const file = e.target.files?.[0]; if (file) onImport(file); e.target.value = ''; }; return (
); };