Files
paseo/packages/app/src/components/agent-status-dot.tsx
T
2026-02-10 10:50:54 +07:00

38 lines
825 B
TypeScript

import { View } from "react-native";
import { StyleSheet, useUnistyles } from "react-native-unistyles";
export function AgentStatusDot({
status,
requiresAttention,
showInactive = false,
}: {
status: string | null | undefined;
requiresAttention: boolean | null | undefined;
showInactive?: boolean;
}) {
const { theme } = useUnistyles();
const isRunning = status === "running";
const color = isRunning
? theme.colors.palette.blue[500]
: requiresAttention
? theme.colors.success
: showInactive
? theme.colors.border
: null;
if (!color) {
return null;
}
return <View style={[styles.dot, { backgroundColor: color }]} />;
}
const styles = StyleSheet.create((theme) => ({
dot: {
width: 8,
height: 8,
borderRadius: theme.borderRadius.full,
},
}));