Skip to content

Commit 7c41d49

Browse files
committed
chore: some minor cleanups
1 parent 5b3e949 commit 7c41d49

File tree

2 files changed

+8
-23
lines changed

2 files changed

+8
-23
lines changed

src/components/ui/combobox.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,21 @@ import {
88
CommandList,
99
CommandSeparator,
1010
} from "@/components/ui/command";
11+
import Kbd from "@/components/ui/kbd";
1112
import {
1213
Popover,
1314
PopoverContent,
1415
PopoverTrigger,
1516
} from "@/components/ui/popover";
1617
import { cn } from "@/lib/utils";
18+
import { RiCheckFill as CheckIcon } from "@remixicon/react";
1719
import type React from "react";
1820
import { useEffect, useRef, useState } from "react";
19-
import { CheckIcon, type IconProps } from "./icons";
2021

2122
export type ComboBoxOption = {
2223
value: string;
2324
label: string;
24-
icon?: React.FC<IconProps>;
25+
icon?: React.FC<{ className: string }>;
2526
};
2627

2728
export const LinearCombobox = ({
@@ -41,7 +42,6 @@ export const LinearCombobox = ({
4142
);
4243
const [searchValue, setSearchValue] = useState("");
4344
const onValueChangeRef = useRef(onValueChange);
44-
const isSearching = searchValue.length > 0;
4545

4646
useEffect(() => {
4747
if (selectedOption && onValueChangeRef.current) {
@@ -56,7 +56,7 @@ export const LinearCombobox = ({
5656
aria-label="Select option"
5757
variant="outline"
5858
size="lg"
59-
className="w-full px-3 h-10 text-[0.8125rem] leading-normal font-medium text-primary"
59+
className="w-full px-3 h-10 text-[0.8125rem] leading-normal font-medium text-primary text-left items-center justify-start"
6060
>
6161
{selectedOption ? (
6262
<>
@@ -98,7 +98,7 @@ export const LinearCombobox = ({
9898
setSearchValue(value);
9999
}}
100100
className="text-[0.8125rem] leading-normal"
101-
placeholder="Type Option no"
101+
placeholder="Search or type option #"
102102
/>
103103

104104
<CommandList>
@@ -117,7 +117,9 @@ export const LinearCombobox = ({
117117
className="group rounded-md flex justify-between items-center w-full text-[0.8125rem] leading-normal text-primary"
118118
>
119119
<div className="flex items-center gap-x-2">
120-
<div className="min-w-3 text-center">{index}</div>
120+
<div className="min-w-3 text-center">
121+
<Kbd className="mr-3">{index}</Kbd>
122+
</div>
121123
<div className="flex items-center">
122124
{option.icon && (
123125
<option.icon className="mr-2 size-4 fill-muted-foreground group-hover:fill-primary" />

src/components/ui/icons.tsx

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)