diff --git a/packages/app/src/components/high_risk_icon.tsx b/packages/app/src/components/high_risk_icon.tsx new file mode 100644 index 00000000..4d0a5420 --- /dev/null +++ b/packages/app/src/components/high_risk_icon.tsx @@ -0,0 +1,8 @@ +import { PropsWithChildren } from 'react' +import { GoXCircle } from 'react-icons/go' + +export type HighRiskProps = {} + +export function HighRiskIcon({ ...props }: PropsWithChildren) { + return +} diff --git a/packages/app/src/components/low_risk_icon.tsx b/packages/app/src/components/low_risk_icon.tsx new file mode 100644 index 00000000..9419818b --- /dev/null +++ b/packages/app/src/components/low_risk_icon.tsx @@ -0,0 +1,8 @@ +import { PropsWithChildren } from 'react' +import { GoBug } from 'react-icons/go' + +export type LowRiskProps = {} + +export function LowRisk({ ...props }: PropsWithChildren) { + return +} diff --git a/packages/app/src/components/medium_risk_icon.tsx b/packages/app/src/components/medium_risk_icon.tsx new file mode 100644 index 00000000..22549e3a --- /dev/null +++ b/packages/app/src/components/medium_risk_icon.tsx @@ -0,0 +1,8 @@ +import { PropsWithChildren } from 'react' +import { GoAlert } from 'react-icons/go' + +export type MediumRiskProps = {} + +export function MediumRisk({ ...props }: PropsWithChildren) { + return +} diff --git a/packages/app/src/components/risk_icon.tsx b/packages/app/src/components/risk_icon.tsx new file mode 100644 index 00000000..91863fee --- /dev/null +++ b/packages/app/src/components/risk_icon.tsx @@ -0,0 +1,28 @@ +import { PropsWithChildren } from 'react' +import { QuestionRisk } from '@/db/models/lens-pillar-risks' +import { HighRiskIcon } from '@/components/high_risk_icon' +import { MediumRisk } from '@/components/medium_risk_icon' +import { LowRisk } from '@/components/low_risk_icon' + +export type RiskIconProps = { + risk?: QuestionRisk +} + +export function RiskIcon({ + risk = QuestionRisk.None, + ...props +}: PropsWithChildren) { + if (risk === QuestionRisk.High) { + return + } + + if (risk === QuestionRisk.Medium) { + return + } + + if (risk === QuestionRisk.Low) { + return + } + + return <> +} diff --git a/packages/app/src/db/models/workload-lenses-answers.ts b/packages/app/src/db/models/workload-lenses-answers.ts index 7613cb86..cee17f23 100644 --- a/packages/app/src/db/models/workload-lenses-answers.ts +++ b/packages/app/src/db/models/workload-lenses-answers.ts @@ -58,12 +58,12 @@ export class WorkloadLensAnswer extends Model< @ForeignKey(() => Workload) @Unique('workload-lens-pillar-question') @Column(DataType.UUID) - workloadId?: string + workloadId!: string @ForeignKey(() => LensPillarQuestion) @Unique('workload-lens-pillar-question') @Column - lensPillarQuestionId?: bigint + lensPillarQuestionId!: bigint @AllowNull @Min(12)