File tree Expand file tree Collapse file tree 2 files changed +52
-1
lines changed
Expand file tree Collapse file tree 2 files changed +52
-1
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,10 @@ export const Oops: FC<OopsProps> = ({
1919 error,
2020 fullHeight = true ,
2121} : OopsProps ) => {
22- const err = error ?? Errors . UNKNOWN ;
2322 const navigate = useNavigate ( ) ;
2423
24+ const err = error ?? Errors . UNKNOWN ;
25+
2526 const emoji = useMemo ( ( ) => randomElement ( err . emojis ) , [ err ] ) ;
2627
2728 const actions = err . actions ?. length
Original file line number Diff line number Diff line change @@ -175,20 +175,59 @@ export interface GitifyUser {
175175 id : string ;
176176}
177177
178+ /**
179+ * Gitify error details.
180+ */
178181export interface GitifyError {
182+ /**
183+ * The title of the error.
184+ */
179185 title : string ;
186+
187+ /**
188+ * The description paragraphs explaining the error.
189+ */
180190 descriptions : string [ ] ;
191+
192+ /**
193+ * An array of emojis that suitably summarize the error message.
194+ */
181195 emojis : string [ ] ;
196+
197+ /**
198+ * Optional actions that can be taken to resolve the error.
199+ */
182200 actions ?: GitifyErrorAction [ ] ;
183201}
184202
203+ /**
204+ * An action that can be taken to resolve an error.
205+ */
185206export interface GitifyErrorAction {
207+ /**
208+ * The label for the error action button.
209+ */
186210 label : string ;
211+
212+ /**
213+ * The route to navigate to when the error action button is clicked.
214+ */
187215 route : string ;
216+
217+ /**
218+ * The visual variant of the error action button.
219+ */
188220 variant : VariantType ;
221+
222+ /**
223+ * The icon to display on the error action button.
224+ */
189225 icon : FC < OcticonProps > ;
190226}
191227
228+ /**
229+ * The different types of errors which may be encountered.
230+ */
192231export type ErrorType =
193232 | 'BAD_CREDENTIALS'
194233 | 'MISSING_SCOPES'
@@ -230,8 +269,19 @@ export enum Size {
230269 XLARGE = 20 ,
231270}
232271
272+ /**
273+ * Details for Chevron header accordion.
274+ */
233275export interface Chevron {
276+ /**
277+ * The chevron icon.
278+ */
279+ // TODO - improve the type here to be more specific about which icons are allowed, if possible
234280 icon : FC < OcticonProps > ;
281+
282+ /**
283+ * The chevron label.
284+ */
235285 label : string ;
236286}
237287
You can’t perform that action at this time.
0 commit comments