Directory page UI update

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak
2024-07-01 20:43:36 +02:00
parent 66d1334539
commit c91fe8fd5b
3 changed files with 40 additions and 35 deletions

View File

@ -133,4 +133,4 @@ const ListItem: React.FC<IListItem> = ({ className, label, hint, children, to, h
);
};
export { List as default, ListItem };
export { List as default, type IListItem, ListItem };

View File

@ -1,6 +1,6 @@
import React from 'react';
import List, { ListItem } from './list';
import List, { type IListItem, ListItem } from './list';
interface IRadioGroup {
onChange: React.ChangeEventHandler;
@ -15,7 +15,7 @@ const RadioGroup = ({ onChange, children }: IRadioGroup) => {
return <List>{childrenWithProps}</List>;
};
interface IRadioItem {
interface IRadioItem extends IListItem {
label: React.ReactNode;
hint?: React.ReactNode;
value: string;
@ -23,8 +23,8 @@ interface IRadioItem {
onChange?: React.ChangeEventHandler;
}
const RadioItem: React.FC<IRadioItem> = ({ label, hint, checked = false, onChange, value }) => (
<ListItem label={label} hint={hint}>
const RadioItem: React.FC<IRadioItem> = ({ label, hint, checked = false, onChange, value, ...props }) => (
<ListItem label={label} hint={hint} {...props}>
<input
type='radio'
checked={checked}