[WEB-3737]chore: estimates code refactor and translations (#6857)

* * chore: refactored estimates components.
* chore: added translations for estimates components.

* fix: translation key update
This commit is contained in:
Vamsi Krishna 2025-04-04 16:59:12 +05:30 committed by GitHub
parent 9c1b158291
commit 9c10235fca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 1309 additions and 133 deletions

View file

@ -50,6 +50,7 @@ export const DropdownOptions: React.FC<IMultiSelectDropdownOptions | ISingleSele
<Combobox.Option
key={keyExtractor(option)}
value={keyExtractor(option)}
disabled={option.disabled}
className={({ active, selected }) =>
cn(
"flex w-full cursor-pointer select-none items-center justify-between gap-2 truncate rounded px-1 py-1.5",
@ -66,7 +67,7 @@ export const DropdownOptions: React.FC<IMultiSelectDropdownOptions | ISingleSele
{({ selected }) => (
<>
{renderItem ? (
<>{renderItem({ value: keyExtractor(option), selected })}</>
<>{renderItem({ value: keyExtractor(option), selected, disabled: option.disabled })}</>
) : (
<>
<span className="flex-grow truncate">{option.value}</span>

View file

@ -27,7 +27,15 @@ export interface IDropdown {
queryArray?: string[];
sortByKey?: string;
firstItem?: (optionValue: string) => boolean;
renderItem?: ({ value, selected }: { value: string; selected: boolean }) => React.ReactNode;
renderItem?: ({
value,
selected,
disabled,
}: {
value: string;
selected: boolean;
disabled?: boolean;
}) => React.ReactNode;
loader?: React.ReactNode;
disableSorting?: boolean;
}
@ -35,7 +43,8 @@ export interface IDropdown {
export interface TDropdownOption {
data: any;
value: string;
className?: ({ active, selected }: { active: boolean; selected: boolean }) => string;
className?: ({ active, selected }: { active: boolean; selected?: boolean }) => string;
disabled?: boolean;
}
export interface IMultiSelectDropdown extends IDropdown {
@ -82,7 +91,9 @@ export interface IDropdownOptions {
handleClose?: () => void;
keyExtractor: (option: TDropdownOption) => string;
renderItem: (({ value, selected }: { value: string; selected: boolean }) => React.ReactNode) | undefined;
renderItem:
| (({ value, selected, disabled }: { value: string; selected: boolean; disabled?: boolean }) => React.ReactNode)
| undefined;
options: TDropdownOption[] | undefined;
loader?: React.ReactNode;
isMobile?: boolean;