add subscription to org

This commit is contained in:
2026-01-17 23:45:25 -03:00
parent d0a9998bf4
commit 3f0f7ec1e1
14 changed files with 550 additions and 367 deletions

View File

@@ -89,108 +89,104 @@ export default function Route({}: Route.ComponentProps) {
return (
<Form {...form}>
<form onSubmit={handleSubmit(onSubmit)}>
<fieldset disabled={!!user?.rate_limit_exceeded} className="space-y-4">
{user?.rate_limit_exceeded && (
<Alert variant="destructive">
<AlertCircleIcon />
<AlertTitle>Limite diário de atualizações atingido.</AlertTitle>
<AlertDescription>
Tente novamente a partir de{' '}
{getDaysRemaining(user.rate_limit_exceeded.ttl)}
</AlertDescription>
</Alert>
)}
<form onSubmit={handleSubmit(onSubmit)} className="space-y-3">
{user?.rate_limit_exceeded && (
<Alert variant="destructive">
<AlertCircleIcon />
<AlertTitle>Limite diário de atualizações atingido.</AlertTitle>
<AlertDescription>
Tente novamente a partir de{' '}
{getDaysRemaining(user.rate_limit_exceeded.ttl)}
</AlertDescription>
</Alert>
)}
<Card>
<CardHeader>
<CardTitle className="text-2xl">Editar colaborador</CardTitle>
<CardDescription>
Configurar as informações gerais para este colaborador.
</CardDescription>
</CardHeader>
<Card>
<CardHeader>
<CardTitle className="text-2xl">Editar colaborador</CardTitle>
<CardDescription>
Configurar as informações gerais para este colaborador.
</CardDescription>
</CardHeader>
<CardContent>
<FieldSet>
<FormField
control={control}
name="name"
render={({ field }) => (
<FormItem>
<FormLabel>Nome</FormLabel>
<FormControl>
<Input {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<CardContent className="space-y-6">
<FieldSet disabled={!!user?.rate_limit_exceeded}>
<FormField
control={control}
name="name"
render={({ field }) => (
<FormItem>
<FormLabel>Nome</FormLabel>
<FormControl>
<Input {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={control}
name="email"
disabled={true}
render={({ field }) => (
<FormItem>
<FormLabel>Email</FormLabel>
<FormControl>
<Input {...field} />
</FormControl>
<FormLabel className="text-sm font-normal text-muted-foreground">
<span>
Para gerenciar os emails ou trocar o email principal,
use as{' '}
<Link
to="emails"
className="text-blue-400 underline hover:no-underline"
>
configurações de emails
</Link>
</span>
</FormLabel>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={control}
name="email"
disabled={true}
render={({ field }) => (
<FormItem>
<FormLabel>Email</FormLabel>
<FormControl>
<Input {...field} />
</FormControl>
<FormLabel className="text-sm font-normal text-muted-foreground">
<span>
Para gerenciar os emails ou trocar o email principal,
use as{' '}
<Link
to="emails"
className="text-blue-400 underline hover:no-underline"
>
configurações de emails
</Link>
</span>
</FormLabel>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={control}
name="cpf"
render={({ field: { onChange, ref, ...props } }) => (
<FormItem>
<FormLabel>CPF</FormLabel>
<FormControl>
<PatternFormat
format="###.###.###-##"
mask="_"
placeholder="___.___.___-__"
customInput={Input}
getInputRef={ref}
onValueChange={({ value }) => {
onChange(value)
}}
{...props}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={control}
name="cpf"
render={({ field: { onChange, ref, ...props } }) => (
<FormItem>
<FormLabel>CPF</FormLabel>
<FormControl>
<PatternFormat
format="###.###.###-##"
mask="_"
placeholder="___.___.___-__"
customInput={Input}
getInputRef={ref}
onValueChange={({ value }) => {
onChange(value)
}}
{...props}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</FieldSet>
<div className="flex justify-end">
<Button
type="submit"
className="cursor-pointer"
disabled={formState.isSubmitting}
>
{formState.isSubmitting && <Spinner />}
Editar
</Button>
</div>
</FieldSet>
</CardContent>
</Card>
</fieldset>
<Button
type="submit"
className="cursor-pointer"
disabled={formState.isSubmitting || !!user?.rate_limit_exceeded}
>
{formState.isSubmitting && <Spinner />}
Editar colaborador
</Button>
</CardContent>
</Card>
</form>
</Form>
)