mirror of
https://github.com/morten-olsen/refocus.dev.git
synced 2026-02-08 00:46:25 +01:00
fix: improved UI
This commit is contained in:
28
packages/widgets/src/github/workflow-run/index.widget.tsx
Normal file
28
packages/widgets/src/github/workflow-run/index.widget.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import { Widget } from '@refocus/sdk';
|
||||
import { SiGithub } from 'react-icons/si';
|
||||
import { schema } from './schema';
|
||||
import { Edit } from './edit';
|
||||
import { View } from './view';
|
||||
|
||||
const widget: Widget<typeof schema> = {
|
||||
name: 'Github Workflow Run',
|
||||
description: 'Display information about a specific workflow run.',
|
||||
icon: <SiGithub />,
|
||||
id: 'github.workflow-run',
|
||||
parseUrl: (url) => {
|
||||
if (url.hostname !== 'github.com') {
|
||||
return;
|
||||
}
|
||||
const pathParts = url.pathname.split('/').filter(Boolean);
|
||||
const [owner, repo, type, subtype, id] = pathParts.slice(0);
|
||||
if (type !== 'actions' || subtype !== 'runs' || !id) {
|
||||
return;
|
||||
}
|
||||
return { owner, repo, id: parseInt(id, 10) };
|
||||
},
|
||||
schema,
|
||||
component: View,
|
||||
edit: Edit,
|
||||
};
|
||||
|
||||
export default widget;
|
||||
Reference in New Issue
Block a user