eletrotupi / tcc/ frontend/components/misc/NoLinkMessage.tsxc901c35af9c84b6a29e5185545ced1129f33b8f4
1.2 KB | 51 lines Raw
1
import React from "react";
2
import { View, StyleSheet } from "react-native";
3
import { Text } from "@/components/ui/Text";
4
import { Ionicons } from "@expo/vector-icons";
5
import { Colors, Typography, Spacing } from "@/constants/theme";
6

7
const styles = StyleSheet.create({
8
  container: {
9
    flexDirection: "row",
10
    alignItems: "flex-start",
11
    gap: 8,
12
    paddingHorizontal: 4,
13
    paddingVertical: Spacing.cardGap,
14
  },
15
  text: {
16
    ...Typography.bodyMd,
17
    color: Colors.light.textSecondary,
18
    flex: 1,
19
    lineHeight: 20,
20
    fontStyle: 'italic',
21
    fontSize: 12
22
  },
23
  bold: {
24
    fontWeight: "700"
25
  },
26
});
27

28
const MESSAGES = {
29
  general: (
30
    <>
31
      Registros também podem ser
32
      <Text style={styles.bold}> Sem vínculo </Text>
33
      ou{" "}
34
      <Text style={styles.bold}>Vinculados a uma ação de cuidado</Text> (ex:
35
      Meditação, Exercício).
36
    </>
37
  ),
38
};
39

40
interface NoLinkMessageProps {
41
  variant?: keyof typeof MESSAGES;
42
}
43

44
export function NoLinkMessage({ variant = "general" }: NoLinkMessageProps) {
45
  return (
46
    <View style={styles.container}>
47
      <Ionicons name="information-circle-outline" size={20} color={Colors.light.textSecondary} />
48
      <Text style={styles.text}>{MESSAGES[variant] ?? MESSAGES.general}</Text>
49
    </View>
50
  );
51
}