Open History to see the last commit
1import type { ComponentProps } from "react";
2import { Pressable } from "react-native";
3
4import { AppText as Text } from "../../components/ui/AppText";
5import { cn } from "../../lib/cn";
6
7export function RequestActionButton({
8 label,
9 tone = "primary",
10 size = "default",
11 disabled,
12 ...props
13}: Omit<ComponentProps<typeof Pressable>, "children" | "className" | "style"> & {
14 label: string;
15 tone?: "primary" | "secondary" | "danger";
16 size?: "default" | "large";
17}) {
18 return (
19 <Pressable
20 {...props}
21 accessibilityRole="button"
22 accessibilityState={{ ...props.accessibilityState, disabled: Boolean(disabled) }}
23 disabled={disabled}
24 className={cn(
25 "items-center justify-center active:opacity-70 disabled:opacity-50",
26 size === "large" ? "rounded-2xl px-4 py-3.5" : "rounded-[14px] px-3.5 py-3",
27 tone === "primary" ? "bg-primary" : tone === "danger" ? "bg-danger" : "bg-subtle-strong",
28 )}
29 >
30 <Text
31 className={cn(
32 "text-sm",
33 tone === "primary"
34 ? "font-t3-extrabold text-primary-foreground"
35 : tone === "danger"
36 ? "font-t3-bold text-danger-foreground"
37 : "font-t3-bold text-foreground",
38 )}
39 >
40 {label}
41 </Text>
42 </Pressable>
43 );
44}