-1

I'm trying to write an interface for a status option in my Props interface. See code below

interface Props {
  title: string;
  message: string;
  show: boolean;
  status: Status;
}

interface Status {
  warning: string;
  error: string;
  info: string;
  success: string;
}

However, I know this isn't the correct implementation. How would I go about this?

Furkan Öztürk
  • 441
  • 4
  • 21

1 Answers1

0

Found what I was looking for here: How to require a specific string in TypeScript interface

In my case it meant

interface Props {
  title: string;
  message: string;
  show: boolean;
  status: "success" | "error" | "info" | "warning";
}
Furkan Öztürk
  • 441
  • 4
  • 21