refactor: clean up settings file for better structure

This commit is contained in:
Siddhant Rai
2024-04-05 23:38:59 +05:30
3 changed files with 20 additions and 4 deletions

View File

@@ -14,6 +14,8 @@ function Dropdown({
showDelete,
onDelete,
placeholder,
fullWidth,
alignMidddle,
}: {
options:
| string[]
@@ -31,8 +33,8 @@ function Dropdown({
showDelete?: boolean;
onDelete?: (value: string) => void;
placeholder?: string;
className?: string;
width?: string;
fullWidth?: boolean;
alignMidddle?: boolean;
}) {
const [isOpen, setIsOpen] = React.useState(false);
return (
@@ -56,7 +58,9 @@ function Dropdown({
</span>
) : (
<span
className={`overflow-hidden text-ellipsis dark:text-bright-gray ${
className={`${
alignMidddle && 'flex-1'
} overflow-hidden text-ellipsis dark:text-bright-gray ${
!selectedValue && 'text-silver dark:text-gray-400'
}`}
>