Skip to content

Commit

Permalink
Add component for radio settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Malte-Hansen committed Nov 18, 2024
1 parent 1b36c6c commit 244c3bc
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { on } from '@ember/modifier';
import { fn } from '@ember/helper';
import HelpTooltip from 'explorviz-frontend/components/help-tooltip';
import stringComparison from 'explorviz-frontend/helpers/string-comparison';

<template>
<HelpTooltip @title={{@setting.description}} />
<span>{{@setting.displayName}}:</span>
<div style='margin-left: 1.5rem'>
{{#each @setting.values as |value|}}
<div class='form-check'>
<input
class='form-check-input'
type='radio'
name='flexRadioDefault'
id={{value}}
{{on 'change' (fn @onChange value)}}
checked={{stringComparison @setting.value value}}
/>
<label class='form-check-label' for={{value}}>
{{value}}
</label>
</div>
{{/each}}
</div>
</template>

0 comments on commit 244c3bc

Please sign in to comment.