Files
supabase/apps/studio/components/interfaces/Integrations/CronJobs/HttpRequestSection.tsx
Gildas Garcia 5d97339d41 chore: remove <Select> _Shadcn_ suffix (#45988)
## Problem

The `_Shadcn_` suffix isn't needed anymore on `Select` components

## Solution

Remove it. No other changes

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Refactor**
* Updated internal component architecture to standardize and simplify
the codebase. These changes improve code maintainability and consistency
across the application without affecting existing functionality or user
experience.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/45988)

<!-- review_stack_entry_end -->

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-05-15 16:39:57 +02:00

82 lines
2.3 KiB
TypeScript

import { UseFormReturn } from 'react-hook-form'
import {
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
Input,
InputGroup,
InputGroupAddon,
InputGroupInput,
InputGroupText,
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
SheetSection,
} from 'ui'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import { CreateCronJobForm } from './CreateCronJobSheet/CreateCronJobSheet.constants'
interface HttpRequestSectionProps {
form: UseFormReturn<CreateCronJobForm>
}
export const HttpRequestSection = ({ form }: HttpRequestSectionProps) => {
return (
<SheetSection className="flex flex-col gap-3">
<FormField
control={form.control}
name="values.method"
render={({ field }) => (
<FormItem>
<FormLabel>Method</FormLabel>
<Select onValueChange={field.onChange} value={field.value}>
<FormControl>
<SelectTrigger>
<SelectValue placeholder="Select a method for the HTTP request" />
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value="GET">GET</SelectItem>
<SelectItem value="POST">POST</SelectItem>
</SelectContent>
</Select>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="values.endpoint"
render={({ field: { ref, ...rest } }) => (
<FormItemLayout label="Endpoint URL" className="gap-1">
<FormControl>
<Input {...rest} placeholder="https://api.example.com/endpoint" />
</FormControl>
</FormItemLayout>
)}
/>
<FormField
control={form.control}
name="values.timeoutMs"
render={({ field: { ref, ...rest } }) => (
<FormItemLayout label="Timeout" className="gap-1">
<InputGroup>
<InputGroupInput {...rest} type="number" placeholder="1000" />
<InputGroupAddon align="inline-end">
<InputGroupText> ms</InputGroupText>
</InputGroupAddon>
</InputGroup>
</FormItemLayout>
)}
/>
</SheetSection>
)
}