Skip to content

Commit

Permalink
fix ts complimation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pjdotson committed Nov 3, 2024
1 parent 9546a81 commit 5d459cf
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
37 changes: 27 additions & 10 deletions console/src/hardware/labjack/device/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// License, use of this software will be governed by the Apache License, Version 2.0,
// included in the file licenses/APL.txt.

import { Override, Select } from "@synnaxlabs/pluto";
import { Select } from "@synnaxlabs/pluto";
import { KeyedNamed } from "@synnaxlabs/x";

import {
Expand Down Expand Up @@ -52,13 +52,30 @@ const OUTPUT_CHANNEL_TYPES: KeyedNamed<OutputChannelType>[] = [
{ key: "DO", name: "Digital Out" },
];

export const SelectInputChannelType = Override.createComponent<
Select.SingleProps<InputChannelType, KeyedNamed<InputChannelType>>
>(Select.Button, {
data: INPUT_CHANNEL_TYPES,
entryRenderKey: "name",
});
export interface SelectInputChannelTypeProps
extends Omit<
Select.ButtonProps<InputChannelType, KeyedNamed<InputChannelType>>,
"data"
> {}

export const SelectOutputChannelType = Override.createComponent<
Select.SingleProps<OutputChannelType, KeyedNamed<OutputChannelType>>
>(Select.Button, { data: OUTPUT_CHANNEL_TYPES, entryRenderKey: "name" });
export const SelectInputChannelType = (props: SelectInputChannelTypeProps) => (
<Select.Button<InputChannelType, KeyedNamed<InputChannelType>>
data={INPUT_CHANNEL_TYPES}
entryRenderKey="name"
{...props}
/>
);

export interface SelectOutputChannelTypeProps
extends Omit<
Select.ButtonProps<OutputChannelType, KeyedNamed<OutputChannelType>>,
"data"
> {}

export const SelectOutputChannelType = (props: SelectOutputChannelTypeProps) => (
<Select.Button<OutputChannelType, KeyedNamed<OutputChannelType>>
data={OUTPUT_CHANNEL_TYPES}
entryRenderKey="name"
{...props}
/>
);
2 changes: 1 addition & 1 deletion pluto/src/override/factory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// License, use of this software will be governed by the Apache License, Version 2.0,
// included in the file licenses/APL.txt.

import { type FC, PropsWithoutRef } from "react";
import { type FC, type PropsWithoutRef } from "react";

export const createComponent = <P extends PropsWithoutRef<any>>(
Base: FC<P>,
Expand Down

0 comments on commit 5d459cf

Please sign in to comment.