1import { SymbolView } from "../../components/AppSymbol";
2import { Pressable, View } from "react-native";
3
4export interface SidebarHeaderActionsProps {
5 readonly onOpenSettings: () => void;
6}
7
8function FallbackHeaderButton(props: {
9 readonly accessibilityLabel: string;
10 readonly icon: "gearshape" | "square.and.pencil";
11 readonly onPress: () => void;
12}) {
13 return (
14 <Pressable
15 className="size-11 items-center justify-center rounded-full bg-subtle active:opacity-70"
16 accessibilityLabel={props.accessibilityLabel}
17 accessibilityRole="button"
18 hitSlop={4}
19 onPress={props.onPress}
20 >
21 <SymbolView
22 name={props.icon}
23 size={18}
24 tintColorClassName="accent-foreground"
25 type="monochrome"
26 />
27 </Pressable>
28 );
29}
30
31export function SidebarHeaderActions(props: SidebarHeaderActionsProps) {
32 return (
33 <View className="flex-row items-center gap-0.5">
34 <FallbackHeaderButton
35 accessibilityLabel="Open settings"
36 icon="gearshape"
37 onPress={props.onOpenSettings}
38 />
39 </View>
40 );
41}