'use client' import React, { useEffect, useState } from 'react'; import { TimePicker } from 'antd'; import { DownOutlined } from '@ant-design/icons'; export const CustomTimePicker = (props: any) => { const { label, value, ...other } = props; const [isActiveLabel, setIsActiveLabel] = useState(false); useEffect(() => { if (label) { setIsActiveLabel(!!value); } else { setIsActiveLabel(false); } }, [value]); const onOpenChange = (open: boolean) => { if (open) { if (!isActiveLabel) setIsActiveLabel(true) } else { setIsActiveLabel(!!value) } }; return (
{label}
} {...other} />
); };