style: do inputs design modification
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import type { ComponentProps } from 'react';
|
||||
import type { FieldErrors, UseFormRegister, UseFormReturn } from 'react-hook-form';
|
||||
import type { FieldErrors, UseFormRegister } from 'react-hook-form';
|
||||
import { Loader2, MapPin, Milestone } from 'lucide-react';
|
||||
|
||||
import { FormField } from '@/components/form';
|
||||
@@ -42,7 +42,7 @@ interface SegmentDialogProps {
|
||||
onDirectionChange: (direction: 'UP' | 'DOWN') => void;
|
||||
register: UseFormRegister<SegmentFormValues>;
|
||||
errors: FieldErrors<SegmentFormValues>;
|
||||
touchedFields: UseFormReturn<SegmentFormValues>['formState']['touchedFields'];
|
||||
isSubmitted: boolean;
|
||||
onSubmit: ComponentProps<'form'>['onSubmit'];
|
||||
canSubmit: boolean;
|
||||
isSaving: boolean;
|
||||
@@ -64,13 +64,13 @@ export function SegmentDialog({
|
||||
onDirectionChange,
|
||||
register,
|
||||
errors,
|
||||
touchedFields,
|
||||
isSubmitted,
|
||||
onSubmit,
|
||||
canSubmit,
|
||||
isSaving,
|
||||
}: SegmentDialogProps) {
|
||||
const getError = (field: keyof SegmentFormValues) =>
|
||||
touchedFields[field] ? errors[field]?.message : undefined;
|
||||
isSubmitted ? errors[field]?.message : undefined;
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
@@ -131,7 +131,9 @@ export function SegmentDialog({
|
||||
Loading...
|
||||
</span>
|
||||
) : (
|
||||
<SelectValue placeholder={projectId ? 'Choose a package' : 'Select project first'} />
|
||||
<SelectValue
|
||||
placeholder={projectId ? 'Choose a package' : 'Select project first'}
|
||||
/>
|
||||
)}
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
@@ -278,7 +280,12 @@ export function SegmentDialog({
|
||||
</div>
|
||||
|
||||
<DialogFooter>
|
||||
<Button type="button" variant="outline" onClick={() => onOpenChange(false)} disabled={isSaving}>
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
onClick={() => onOpenChange(false)}
|
||||
disabled={isSaving}
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button type="submit" disabled={isSaving || !canSubmit}>
|
||||
|
||||
Reference in New Issue
Block a user