mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-22 08:56:44 +00:00
16 lines
483 B
TypeScript
16 lines
483 B
TypeScript
export type PropertiesFooterAction = 'discardChanges' | 'save' | 'close' | 'keepEditing';
|
|
|
|
export type PropertiesFooterState = {
|
|
isDirty: boolean;
|
|
hasUnsavedNavigation: boolean;
|
|
};
|
|
|
|
export const getPropertiesFooterActions = ({
|
|
isDirty,
|
|
hasUnsavedNavigation,
|
|
}: PropertiesFooterState): PropertiesFooterAction[] => {
|
|
if (hasUnsavedNavigation) return ['discardChanges', 'save', 'keepEditing'];
|
|
if (isDirty) return ['discardChanges', 'save', 'close'];
|
|
return ['close'];
|
|
};
|