Fix sorting links when editing and handle not providing any data

This commit is contained in:
Isaac Wise
2024-02-11 01:01:52 -06:00
parent e753f1dded
commit 63597a041f
7 changed files with 45 additions and 32 deletions
@@ -7,15 +7,16 @@ import CreatableSelect from "react-select/creatable";
type Props = {
onChange: any;
showDefaultValue?: boolean;
defaultValue?:
| {
label: string;
value?: number;
}
| undefined;
| {
label: string;
value?: number;
}
| undefined;
};
export default function CollectionSelection({ onChange, defaultValue }: Props) {
export default function CollectionSelection({ onChange, defaultValue, showDefaultValue = true }: Props) {
const { collections } = useCollectionStore();
const router = useRouter();
@@ -50,8 +51,8 @@ export default function CollectionSelection({ onChange, defaultValue }: Props) {
onChange={onChange}
options={options}
styles={styles}
defaultValue={defaultValue}
// menuPosition="fixed"
defaultValue={showDefaultValue ? defaultValue : null}
// menuPosition="fixed"
/>
);
}