2025-07-21 15:10:39 +08:00
|
|
|
import React from 'react';
|
2025-07-21 15:36:11 +08:00
|
|
|
import { Appbar, useTheme } from 'react-native-paper';
|
|
|
|
import { StyleSheet } from 'react-native';
|
2025-07-21 15:10:39 +08:00
|
|
|
|
|
|
|
interface BottomActionBarProps {
|
|
|
|
onRun: () => void;
|
|
|
|
onSave: () => void;
|
|
|
|
onUndo: () => void;
|
|
|
|
onRestore: () => void;
|
|
|
|
onBack: () => void;
|
|
|
|
isSaveDisabled?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
const BottomActionBar: React.FC<BottomActionBarProps> = ({
|
|
|
|
onRun,
|
|
|
|
onSave,
|
|
|
|
onUndo,
|
|
|
|
onRestore,
|
|
|
|
onBack,
|
|
|
|
isSaveDisabled = true,
|
|
|
|
}) => {
|
2025-07-21 15:36:11 +08:00
|
|
|
const theme = useTheme();
|
|
|
|
|
2025-07-21 15:10:39 +08:00
|
|
|
return (
|
2025-07-21 15:36:11 +08:00
|
|
|
<Appbar style={[styles.bottom, { backgroundColor: theme.colors.elevation.level2 }]}>
|
|
|
|
<Appbar.Action icon="arrow-left" onPress={onBack} />
|
|
|
|
<Appbar.Action icon="play" onPress={onRun} />
|
|
|
|
<Appbar.Action icon="content-save" onPress={onSave} disabled={isSaveDisabled} />
|
|
|
|
<Appbar.Action icon="undo" onPress={onUndo} />
|
|
|
|
<Appbar.Action icon="restore" onPress={onRestore} />
|
|
|
|
</Appbar>
|
2025-07-21 15:10:39 +08:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
2025-07-21 15:36:11 +08:00
|
|
|
bottom: {
|
|
|
|
position: 'absolute',
|
|
|
|
left: 0,
|
|
|
|
right: 0,
|
|
|
|
bottom: 0,
|
2025-07-21 15:10:39 +08:00
|
|
|
justifyContent: 'space-around',
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
export default BottomActionBar;
|