+
+ {getActionLabel(ozoneAction.type)}
+
+
+ {['takedown', 'reverseTakedown', 'acknowledge', 'escalate', 'comment', 'label', 'tag'].includes(ozoneAction.type) && (
+
+
+
+ )}
+
+ {ozoneAction.type === 'takedown' && (
+
+
+ setOzoneAction(prev => ({ ...prev, durationInHours: e.target.value }))}
+ placeholder='e.g., 168 for 1 week'
+ className='w-full p-2 text-sm border border-gray-200 rounded-md bg-white text-gray-800 placeholder-gray-400'
+ />
+
+ )}
+
+ {ozoneAction.type === 'comment' && (
+
+ setOzoneAction(prev => ({ ...prev, sticky: e.target.checked }))}
+ className='rounded border-gray-300'
+ />
+
+
+ )}
+
+ {ozoneAction.type === 'label' && (
+ <>
+
+
+
setOzoneAction(prev => ({ ...prev, newLabel: e.target.value }))}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter' && ozoneAction.newLabel.trim()) {
+ e.preventDefault();
+ if (!ozoneAction.createLabelVals.includes(ozoneAction.newLabel.trim())) {
+ setOzoneAction(prev => ({
+ ...prev,
+ createLabelVals: [...prev.createLabelVals, prev.newLabel.trim()],
+ newLabel: '',
+ }));
+ }
+ }
+ }}
+ placeholder='Type label and press Enter'
+ className='w-full p-2 text-sm border border-gray-200 rounded-md bg-white text-gray-800 placeholder-gray-400'
+ />
+ {ozoneAction.createLabelVals.length > 0 && (
+
+ {ozoneAction.createLabelVals.map((label, idx) => (
+
+ +{label}
+
+
+ ))}
+
+ )}
+
+
+
+
{
+ if (e.key === 'Enter') {
+ e.preventDefault();
+ const val = (e.target as HTMLInputElement).value.trim();
+ if (val && !ozoneAction.negateLabelVals.includes(val)) {
+ setOzoneAction(prev => ({ ...prev, negateLabelVals: [...prev.negateLabelVals, val] }));
+ (e.target as HTMLInputElement).value = '';
+ }
+ }
+ }}
+ />
+ {ozoneAction.negateLabelVals.length > 0 && (
+
+ {ozoneAction.negateLabelVals.map((label, idx) => (
+
+ -{label}
+
+
+ ))}
+
+ )}
+
+ >
+ )}
+
+ {ozoneAction.type === 'tag' && (
+ <>
+
+
+
setOzoneAction(prev => ({ ...prev, newTag: e.target.value }))}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter' && ozoneAction.newTag.trim()) {
+ e.preventDefault();
+ if (!ozoneAction.addTags.includes(ozoneAction.newTag.trim())) {
+ setOzoneAction(prev => ({ ...prev, addTags: [...prev.addTags, prev.newTag.trim()], newTag: '' }));
+ }
+ }
+ }}
+ placeholder='Type tag and press Enter'
+ className='w-full p-2 text-sm border border-gray-200 rounded-md bg-white text-gray-800 placeholder-gray-400'
+ />
+ {ozoneAction.addTags.length > 0 && (
+
+ {ozoneAction.addTags.map((tag, idx) => (
+
+ +{tag}
+
+
+ ))}
+
+ )}
+
+
+
+
{
+ if (e.key === 'Enter') {
+ e.preventDefault();
+ const val = (e.target as HTMLInputElement).value.trim();
+ if (val && !ozoneAction.removeTags.includes(val)) {
+ setOzoneAction(prev => ({ ...prev, removeTags: [...prev.removeTags, val] }));
+ (e.target as HTMLInputElement).value = '';
+ }
+ }
+ }}
+ />
+ {ozoneAction.removeTags.length > 0 && (
+
+ {ozoneAction.removeTags.map((tag, idx) => (
+
+ -{tag}
+
+
+ ))}
+
+ )}
+
+ >
+ )}
+
+
+
+
+
+