feat(monorepo): migrate to typescript monorepo

This commit is contained in:
2025-11-07 17:09:29 +02:00
committed by BernardNganduDev
parent 3e09956f05
commit 075a388ccb
745 changed files with 2341 additions and 5082 deletions
@@ -0,0 +1,32 @@
import { GetProps, Label, Switch as TamaguiSwitch, XStack, YStack } from "tamagui";
import { withController } from "@/ui/components/controls/forms/withController";
import { Caption } from "@/ui/components/typography";
type SwitchProps = GetProps<typeof TamaguiSwitch> & {
label: string;
description?: string;
isChecked: boolean;
onCheckedChange: (checked: boolean) => void;
id?: string;
};
export const Switch = (props: SwitchProps) => {
const { label, description, isChecked, onCheckedChange, id, ...rest } = props;
return (
<XStack alignItems="center" gap="$10" justifyContent="space-between" width="100%">
<YStack flex={1} gap="$1">
<Label fontWeight="bold" htmlFor={id}>
{label}
</Label>
{description && <Caption>{description}</Caption>}
</YStack>
<TamaguiSwitch id={id} checked={isChecked} onCheckedChange={onCheckedChange} size="$3" {...rest}>
<TamaguiSwitch.Thumb animation="bouncy" />
</TamaguiSwitch>
</XStack>
);
};
export const FormSwitch = withController<SwitchProps>(Switch);