Files
Gildas Garcia 0facd341a6 chore: remove UI form components _Shadcn_ suffix (#45212)
## Problem

We used to have a `_Shadcn_` suffix for all the shadcn form components
because we also had `formik` form components.
This is not needed anymore.

## Solution

- Remove the suffix
- Update all usages
2026-04-24 12:14:15 +02:00

56 lines
1.7 KiB
TypeScript

import { UseFormReturn } from 'react-hook-form'
import { FormField, Input, Separator, SheetSection } from 'ui'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import { CreateQueueForm } from './CreateQueueSheet.schema'
export function PartitionConfigFields({ form }: { form: UseFormReturn<CreateQueueForm> }) {
const queueType = form.watch('values.type')
if (queueType !== 'partitioned') return null
return (
<>
<SheetSection className="flex flex-col gap-3">
<FormField
control={form.control}
name="values.partitionInterval"
render={({ field: { ref, ...rest } }) => (
<FormItemLayout
label="Partition interval"
description="Number of messages per partition"
className="gap-1"
>
<Input
{...rest}
type="number"
placeholder="10000"
actions={<p className="text-foreground-light pr-2">messages</p>}
/>
</FormItemLayout>
)}
/>
<FormField
control={form.control}
name="values.retentionInterval"
render={({ field: { ref, ...rest } }) => (
<FormItemLayout
label="Retention interval"
description="Partitions older than this many messages behind the latest will be dropped"
className="gap-1"
>
<Input
{...rest}
type="number"
placeholder="100000"
actions={<p className="text-foreground-light pr-2">messages</p>}
/>
</FormItemLayout>
)}
/>
</SheetSection>
<Separator />
</>
)
}