formate
This commit is contained in:
@@ -1,38 +1,35 @@
|
||||
// DateInput.tsx
|
||||
import React from 'react';
|
||||
|
||||
|
||||
interface DateInputProps {
|
||||
label?: string;
|
||||
value?: string;
|
||||
defaultValue?: string;
|
||||
onChange: (value: string) => void;
|
||||
className?: string;
|
||||
label?: string;
|
||||
value?: string;
|
||||
defaultValue?: string;
|
||||
onChange: (value: string) => void;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
|
||||
const DateInput: React.FC<DateInputProps> = ({
|
||||
label = 'Дата',
|
||||
value,
|
||||
defaultValue,
|
||||
onChange,
|
||||
className = '',
|
||||
label = 'Дата',
|
||||
value,
|
||||
defaultValue,
|
||||
onChange,
|
||||
className = '',
|
||||
}) => {
|
||||
return (
|
||||
<div className={`flex flex-col gap-1 ${className}`}>
|
||||
<label className="block text-sm font-medium text-gray-700">
|
||||
{label}
|
||||
</label>
|
||||
<input
|
||||
type="datetime-local"
|
||||
value={value}
|
||||
defaultValue={defaultValue}
|
||||
onChange={(e) => onChange(e.target.value)}
|
||||
className="mt-1 block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
return (
|
||||
<div className={`flex flex-col gap-1 ${className}`}>
|
||||
<label className="block text-sm font-medium text-gray-700">
|
||||
{label}
|
||||
</label>
|
||||
<input
|
||||
type="datetime-local"
|
||||
value={value}
|
||||
defaultValue={defaultValue}
|
||||
onChange={(e) => onChange(e.target.value)}
|
||||
className="mt-1 block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
export default DateInput;
|
||||
export default DateInput;
|
||||
|
||||
Reference in New Issue
Block a user