139 lines
3.0 KiB
TypeScript
139 lines
3.0 KiB
TypeScript
/*
|
|
* File: QuickActions.tsx
|
|
* Description: Quick actions component providing common emergency actions
|
|
* Design & Developed by Tech4Biz Solutions
|
|
* Copyright (c) Spurrin Innovations. All rights reserved.
|
|
*/
|
|
|
|
import React from 'react';
|
|
import {
|
|
View,
|
|
Text,
|
|
TouchableOpacity,
|
|
StyleSheet,
|
|
ScrollView,
|
|
} from 'react-native';
|
|
import { theme } from '../../../theme/theme';
|
|
|
|
interface QuickAction {
|
|
id: string;
|
|
title: string;
|
|
icon: string;
|
|
color: string;
|
|
}
|
|
|
|
interface QuickActionsProps {
|
|
onQuickAction: (action: QuickAction) => void;
|
|
}
|
|
|
|
const quickActions: QuickAction[] = [
|
|
{
|
|
id: 'emergency',
|
|
title: 'Emergency',
|
|
icon: '🚨',
|
|
color: theme.colors.critical,
|
|
},
|
|
{
|
|
id: 'scan',
|
|
title: 'Order Scan',
|
|
icon: '📷',
|
|
color: theme.colors.primary,
|
|
},
|
|
{
|
|
id: 'medication',
|
|
title: 'Medication',
|
|
icon: '💊',
|
|
color: theme.colors.warning,
|
|
},
|
|
{
|
|
id: 'lab',
|
|
title: 'Lab Work',
|
|
icon: '🧪',
|
|
color: theme.colors.info,
|
|
},
|
|
{
|
|
id: 'consult',
|
|
title: 'Consult',
|
|
icon: '👨⚕️',
|
|
color: theme.colors.success,
|
|
},
|
|
{
|
|
id: 'transfer',
|
|
title: 'Transfer',
|
|
icon: '🚑',
|
|
color: theme.colors.secondary,
|
|
},
|
|
];
|
|
|
|
export const QuickActions: React.FC<QuickActionsProps> = ({
|
|
onQuickAction,
|
|
}) => {
|
|
return (
|
|
<View style={styles.container}>
|
|
<Text style={styles.title}>Quick Actions</Text>
|
|
<ScrollView
|
|
horizontal
|
|
showsHorizontalScrollIndicator={false}
|
|
contentContainerStyle={styles.scrollContainer}
|
|
>
|
|
{quickActions.map((action) => (
|
|
<TouchableOpacity
|
|
key={action.id}
|
|
style={styles.actionButton}
|
|
onPress={() => onQuickAction(action)}
|
|
activeOpacity={0.7}
|
|
>
|
|
<View style={[styles.iconContainer, { backgroundColor: action.color + '20' }]}>
|
|
<Text style={styles.icon}>{action.icon}</Text>
|
|
</View>
|
|
<Text style={styles.actionTitle}>{action.title}</Text>
|
|
</TouchableOpacity>
|
|
))}
|
|
</ScrollView>
|
|
</View>
|
|
);
|
|
};
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
marginBottom: theme.spacing.lg,
|
|
},
|
|
title: {
|
|
fontSize: theme.typography.fontSize.displaySmall,
|
|
fontFamily: theme.typography.fontFamily.bold,
|
|
color: theme.colors.textPrimary,
|
|
marginBottom: theme.spacing.md,
|
|
},
|
|
scrollContainer: {
|
|
paddingRight: theme.spacing.md,
|
|
},
|
|
actionButton: {
|
|
alignItems: 'center',
|
|
marginRight: theme.spacing.lg,
|
|
minWidth: 80,
|
|
},
|
|
iconContainer: {
|
|
width: 60,
|
|
height: 60,
|
|
borderRadius: 30,
|
|
justifyContent: 'center',
|
|
alignItems: 'center',
|
|
marginBottom: theme.spacing.sm,
|
|
...theme.shadows.small,
|
|
},
|
|
icon: {
|
|
fontSize: 24,
|
|
},
|
|
actionTitle: {
|
|
fontSize: theme.typography.fontSize.bodySmall,
|
|
color: theme.colors.textPrimary,
|
|
fontFamily: theme.typography.fontFamily.medium,
|
|
textAlign: 'center',
|
|
},
|
|
});
|
|
|
|
/*
|
|
* End of File: QuickActions.tsx
|
|
* Design & Developed by Tech4Biz Solutions
|
|
* Copyright (c) Spurrin Innovations. All rights reserved.
|
|
*/ |