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

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

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

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

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