Skip to content

Commit

Permalink
Update InputSlot.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
ovidiuch committed Mar 2, 2024
1 parent eff6976 commit 256f170
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/react-cosmos-ui/src/slots/InputSlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ import {
} from 'react-cosmos-core';
import { Slot } from 'react-plugin';

export type InputSlotProps<TInput extends InputFixtureState> = {
export type InputSlotProps<T extends InputFixtureState> = {
inputName: string;
input: TInput;
input: T;
onFixtureStateChange: (
updater: FixtureStateUpdater<InputsFixtureState>
) => void;
};

type Props = {
slotProps: InputSlotProps<any>;
type Props<T extends InputFixtureState> = {
slotProps: InputSlotProps<T>;
};

export function InputSlot({ slotProps }: Props) {
export function InputSlot<T extends InputFixtureState>({
slotProps,
}: Props<T>) {
return <Slot name={`input-${slotProps.input.type}`} slotProps={slotProps} />;
}

0 comments on commit 256f170

Please sign in to comment.