Files
Homarr/packages/ui/src/components/select-with-description.tsx
Thomas Camlong f1b1ec59ec chore: update prettier configuration for print width (#519)
* feat: update prettier configuration for print width

* chore: apply code formatting to entire repository

* fix: remove build files

* fix: format issue

---------

Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
2024-05-19 22:38:39 +02:00

31 lines
786 B
TypeScript

"use client";
import { Text } from "@mantine/core";
import type { SelectWithCustomItemsProps } from "./select-with-custom-items";
import { SelectWithCustomItems } from "./select-with-custom-items";
export interface SelectItemWithDescription {
value: string;
label: string;
description: string;
}
type Props = SelectWithCustomItemsProps<SelectItemWithDescription>;
export const SelectWithDescription = (props: Props) => {
return <SelectWithCustomItems<SelectItemWithDescription> {...props} SelectOption={SelectOption} />;
};
const SelectOption = ({ label, description }: SelectItemWithDescription) => {
return (
<div>
<Text fz="sm" fw={500}>
{label}
</Text>
<Text fz="xs" opacity={0.6}>
{description}
</Text>
</div>
);
};