forked from github-starred/komodo
improve Icon
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Generated by typeshare 1.6.0
|
||||
Generated by typeshare 1.7.0
|
||||
*/
|
||||
|
||||
export interface MongoIdObj {
|
||||
|
||||
@@ -121,7 +121,10 @@ export const BuildComponents: RequiredResourceComponents = {
|
||||
Page: {
|
||||
Config: ({ id }) => <BuildConfig id={id} />,
|
||||
},
|
||||
Icon,
|
||||
Icon: ({ id }) => {
|
||||
if (id) return <Icon id={id} />;
|
||||
else return <Hammer className="w-4 h-4" />;
|
||||
},
|
||||
Actions: ({ id }) => {
|
||||
const building = useRead("GetBuildActionState", { id }).data?.building;
|
||||
const { mutate, isPending } = useExecute("RunBuild");
|
||||
|
||||
@@ -34,7 +34,7 @@ const deployment_state_color = (state: Types.DockerContainerState) => {
|
||||
};
|
||||
|
||||
const deployment_state_fill_color = (state: Types.DockerContainerState) => {
|
||||
return `fill-${deployment_state_color(state)}`
|
||||
return `fill-${deployment_state_color(state)}`;
|
||||
};
|
||||
|
||||
const deployment_state_text_color = (state: Types.DockerContainerState) => {
|
||||
@@ -45,7 +45,9 @@ const Icon = ({ id }: { id?: string }) => {
|
||||
const state = useDeployment(id)?.info.state;
|
||||
|
||||
return (
|
||||
<Rocket className={cn("w-4", state && deployment_state_fill_color(state))} />
|
||||
<Rocket
|
||||
className={cn("w-4", state && deployment_state_fill_color(state))}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
2
frontend/src/types.d.ts
vendored
2
frontend/src/types.d.ts
vendored
@@ -6,7 +6,7 @@ type IdComponent = React.FC<{ id: string }>;
|
||||
type OptionalIdComponent = React.FC<{ id?: string }>;
|
||||
|
||||
export interface RequiredResourceComponents {
|
||||
Icon: IdComponent;
|
||||
Icon: OptionalIdComponent;
|
||||
|
||||
New: React.FC;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user