import type { ReactNode } from 'react'; import { Pressable, StyleSheet, Text, View } from 'react-native'; import { fonts, m3Colors, m3Shape, spacing } from '../theme/proulr-theme'; const MEDIA_TILE_SIZE = 88; export function ComposeMediaShortcut({ label, hint, children, onPress, }: { label: string; hint?: string; children: ReactNode; onPress: () => void; }) { return ( {hint ? ( {hint} ) : null} [styles.tile, pressed && { opacity: 0.85 }]} > {children} ); } const styles = StyleSheet.create({ wrap: { alignItems: 'center', }, hintBubble: { marginBottom: spacing.xs, paddingHorizontal: spacing.sm, paddingVertical: spacing.xs, borderRadius: m3Shape.cornerFull, backgroundColor: m3Colors.primary, position: 'relative', }, hintText: { color: m3Colors.onPrimary, fontFamily: fonts.medium, fontSize: 11, }, hintTail: { position: 'absolute', bottom: -5, alignSelf: 'center', width: 0, height: 0, borderLeftWidth: 6, borderRightWidth: 6, borderTopWidth: 6, borderLeftColor: 'transparent', borderRightColor: 'transparent', borderTopColor: m3Colors.primary, }, tile: { width: MEDIA_TILE_SIZE, height: MEDIA_TILE_SIZE, borderRadius: m3Shape.cornerLarge, borderWidth: 1, borderColor: m3Colors.outlineVariant, backgroundColor: m3Colors.surfaceContainer, alignItems: 'center', justifyContent: 'center', }, }); export const COMPOSE_MEDIA_TILE_SIZE = MEDIA_TILE_SIZE;